[Mpuls-commits] r5998 - base/trunk/mpulsweb/model

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Jun 28 14:38:55 CEST 2012


Author: bricks
Date: 2012-06-28 14:38:54 +0200 (Thu, 28 Jun 2012)
New Revision: 5998

Modified:
   base/trunk/mpulsweb/model/document.py
Log:
Fix importing of documents

This fixes an InternalError: FEHLER:  DS ID not session_user ID.
The original code did try to delete the documents several times which leads
to a database constrain violation because the document id is unknown the
second time.


Modified: base/trunk/mpulsweb/model/document.py
===================================================================
--- base/trunk/mpulsweb/model/document.py	2012-06-26 11:17:05 UTC (rev 5997)
+++ base/trunk/mpulsweb/model/document.py	2012-06-28 12:38:54 UTC (rev 5998)
@@ -407,8 +407,9 @@
             if name in known:
                 del known[name]
             import_document(cursor, case_id, document)
-            for doc in known.itervalues():
-                delete_document_with_cursor(cursor, doc.id, True)
+        # delete documents which aren't imported again
+        for doc in known.itervalues():
+            delete_document_with_cursor(cursor, doc.id, True)
 
 
 def import_document(cursor, case_id, document):



More information about the Mpuls-commits mailing list