[Mpuls-commits] r558 - in wasko/trunk: . waskaweb/model

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jul 28 16:33:29 CEST 2009


Author: teichmann
Date: 2009-07-28 16:33:27 +0200 (Tue, 28 Jul 2009)
New Revision: 558

Modified:
   wasko/trunk/ChangeLog.txt
   wasko/trunk/waskaweb/model/case.py
Log:
Fixed creation of new cases.



Modified: wasko/trunk/ChangeLog.txt
===================================================================
--- wasko/trunk/ChangeLog.txt	2009-07-28 14:07:52 UTC (rev 557)
+++ wasko/trunk/ChangeLog.txt	2009-07-28 14:33:27 UTC (rev 558)
@@ -1,3 +1,7 @@
+2009-07-28	Sascha L. Teichmann	<sascha.teichmann at intevation.de>
+
+	* waskaweb/model/case.py: Fixed creation of new cases.
+
 2009-07-28	Torsten Irlaender  <torsten.irlaender at intevation.de> 
 
 	Major change. Replaced navigation, and Formrenderer!

Modified: wasko/trunk/waskaweb/model/case.py
===================================================================
--- wasko/trunk/waskaweb/model/case.py	2009-07-28 14:07:52 UTC (rev 557)
+++ wasko/trunk/waskaweb/model/case.py	2009-07-28 14:33:27 UTC (rev 558)
@@ -62,8 +62,6 @@
 
 from waskaweb.lib.helpers import dd_mm_yyyy_HH_MM, dd_mm_YYYY
 
-from os import tmpnam, unlink
-
 def get_field_identifier(id, name, it=None, idx=0):
     '''Will return the identifier of a field. If the field in in a rg the
     identifier of the first occourance will be returned on default.'''
@@ -89,8 +87,8 @@
     if not rgc: return None 
     rgs = rgc.getChildren()
     if not rgs:
-        pass
-        #rg = rgc.createInstance()
+        print >> sys.stderr, "No repeat group found: create new"
+        rg = rgc.createInstance()
     else:
         rg = rgs[idx]
     return '%s:%s:%s' % (name, rg.getInternalIdentifier(), id)
@@ -459,8 +457,6 @@
                 cur.execute(CREATE_CASE_SQL, {'uuid': uuid})
                 id = int(cur.fetchone()[0])
                 conn.commit()
-                if data:
-                    self._updateMasterOnCreate(id, data)
             finally:
                 db.recycleConnection(conn, cur)
             # XXX: This a workaround the RGs
@@ -469,6 +465,10 @@
             print "Fehler"
             traceback.print_exc(file=sys.stderr)
             return None
+
+        if data:
+            self._updateMasterOnCreate(id, data)
+
         if init == True:
             try:
                 self._initNewCase(id)



More information about the Mpuls-commits mailing list