[Mpuls-commits] r3575 - in waska/branches/1.7: . waskaweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 9 13:02:56 CEST 2010


Author: roland
Date: 2010-09-09 13:02:54 +0200 (Thu, 09 Sep 2010)
New Revision: 3575

Modified:
   waska/branches/1.7/ChangeLog
   waska/branches/1.7/waskaweb/lib/xmlimport.py
Log:
Fix a problem with imports

Modified: waska/branches/1.7/ChangeLog
===================================================================
--- waska/branches/1.7/ChangeLog	2010-09-09 10:53:35 UTC (rev 3574)
+++ waska/branches/1.7/ChangeLog	2010-09-09 11:02:54 UTC (rev 3575)
@@ -1,3 +1,8 @@
+2010-09-09  Roland Geider <roland.geider at intevation.de>
+
+	* waskaweb/lib/xmlimport.py: Fix a problem with imports when no UUID
+	  is available (new imports, etc.)
+
 2010-06-08  Torsten Irländer <torsten.irlaender at intevation.de>
 
 	* waskaweb/lib/helpers.py (get_validity, get_validity_name): Quick fix

Modified: waska/branches/1.7/waskaweb/lib/xmlimport.py
===================================================================
--- waska/branches/1.7/waskaweb/lib/xmlimport.py	2010-09-09 10:53:35 UTC (rev 3574)
+++ waska/branches/1.7/waskaweb/lib/xmlimport.py	2010-09-09 11:02:54 UTC (rev 3575)
@@ -691,12 +691,14 @@
                 try:
                     cm_id = get_id_for_uuid(self.cursor, 'master', self.uuid)
                 except Expeption, e:
-                    print "Could not get ID from UUID"
+                    print "Exception, could not get ID from UUID: %s" % e
                 
-                try:
-                    cm_date_data = get_cm_dates(self.cursor, cm_id)
-                except Exception, e:
-                    print "Could not load CM start/end dates"
+                cm_date_data = set()
+                if cm_id != None:
+                    try:
+                        cm_date_data = get_cm_dates(self.cursor, cm_id)
+                    except Exception, e:
+                        print "Exception while loading CM dates: %s" % e
                 
                 if cm_date_data != set():
                     #print cm_date_data
@@ -709,7 +711,7 @@
                         old_cm_date = cm_date_data[1] # End date of the CM
                     
                     if old_cm_date != new_cm_date and new_cm_date < datetime.date(2010, 01, 01):
-                        print "new dates!"
+                        #print "new dates!"
                         # Error text not really important since it will not be passed to the user
                         raise StandardError("Datum darf nicht vor dem 1.1.2010 liegen")
 



More information about the Mpuls-commits mailing list