From 5aee41468c813cf4310c197ae0174449a2eca8d5 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 10 Jan 2013 14:16:18 +0530 Subject: [PATCH] fix in sync due to missing sid --- webnotes/model/sync.py | 4 +++- webnotes/sessions.py | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/webnotes/model/sync.py b/webnotes/model/sync.py index 7c2f125c36..ef625cd4bd 100644 --- a/webnotes/model/sync.py +++ b/webnotes/model/sync.py @@ -14,7 +14,9 @@ def sync_all(force=0): try: webnotes.clear_cache() except Exception, e: - if e[0]!=1146: raise e + if e.args[0]!=1146: + print webnotes.getTraceback() + raise e return modules def sync_core_doctypes(force=0): diff --git a/webnotes/sessions.py b/webnotes/sessions.py index aaa51cb40d..4fd49ca8b4 100644 --- a/webnotes/sessions.py +++ b/webnotes/sessions.py @@ -46,7 +46,8 @@ def clear_cache(user=None): webnotes.cache().delete_keys("session:") if webnotes.session: webnotes.cache().delete_keys("bootinfo:" + webnotes.session.user) - webnotes.cache().delete_keys("session:" + webnotes.session.sid) + if webnotes.session.sid: + webnotes.cache().delete_keys("session:" + webnotes.session.sid) def clear_sessions(user=None, keep_current=False): if not user: