[Mpuls-commits] r5791 - in base/trunk/mpulsweb: lib model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jan 25 10:43:22 CET 2012


Author: bricks
Date: 2012-01-25 10:43:21 +0100 (Wed, 25 Jan 2012)
New Revision: 5791

Modified:
   base/trunk/mpulsweb/lib/base.py
   base/trunk/mpulsweb/model/document.py
Log:
Also recreate the navigation tree if it isn't present in the the session

If the navigation tree isn't part of the session it must be rebuilded and stored
in the session again.


Modified: base/trunk/mpulsweb/lib/base.py
===================================================================
--- base/trunk/mpulsweb/lib/base.py	2012-01-24 11:49:35 UTC (rev 5790)
+++ base/trunk/mpulsweb/lib/base.py	2012-01-25 09:43:21 UTC (rev 5791)
@@ -154,7 +154,7 @@
         session['case'] = session_case
 
         # Only reset navigation if case is switched
-        if str(old_caseid) != str(id):
+        if str(old_caseid) != str(id) or not session.has_key('navigation.tree'):
             open_folders = []
             navigation = get_navigation(id)
             session['render_mode'] = 'ro'

Modified: base/trunk/mpulsweb/model/document.py
===================================================================
--- base/trunk/mpulsweb/model/document.py	2012-01-24 11:49:35 UTC (rev 5790)
+++ base/trunk/mpulsweb/model/document.py	2012-01-25 09:43:21 UTC (rev 5791)
@@ -227,9 +227,17 @@
         else:
             stmnt = UPDATE_CASE
         fields['case'] = case_id
+    try:
+        cursor.execute(stmnt, fields)
+    except Exception, e:
+        print "stmnt: %s fields: %r" % (stmnt, fields)
+        print "dataerror: %s" % dir(e)
+        print "dataerror: %r" % e
+        print "pgerror: %s" % e.pgerror
+        print "pgcode: %s" % e.pgcode
+        print "args: %s" % e.args
+        raise e
 
-    cursor.execute(stmnt, fields)
-
     return document_id
 
 def rename_document_with_cursor(cursor, id, name, desc, is_case_document):



More information about the Mpuls-commits mailing list