[Mpuls-commits] r1912 - wasko/branches/2.0/mpulsweb/lib

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 8 16:28:28 CET 2010


Author: torsten
Date: 2010-03-08 16:28:27 +0100 (Mon, 08 Mar 2010)
New Revision: 1912

Modified:
   wasko/branches/2.0/mpulsweb/lib/validators.py
Log:
* mpulsweb/lib/validators.py (FileExistsChecker.validate_python):
Fixed SQL statement to check if there is already a file with the name
for the current case.


Modified: wasko/branches/2.0/mpulsweb/lib/validators.py
===================================================================
--- wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-08 15:22:31 UTC (rev 1911)
+++ wasko/branches/2.0/mpulsweb/lib/validators.py	2010-03-08 15:28:27 UTC (rev 1912)
@@ -63,7 +63,7 @@
         so raise an exception if the user did not want to overwrite it.
     """
 
-    casedoc_sql = "SELECT id FROM ka_fall_dokumente_tbl_view WHERE name = '%(filename)s'" 
+    casedoc_sql = "SELECT id FROM ka_fall_dokumente_tbl_view WHERE name = '%(filename)s' and master_id = %(case)s" 
     globaldoc_sql = "SELECT id FROM ka_global_dokumente_tbl_view WHERE name = '%(filename)s'" 
     field_names = None
     validate_partial_form = True
@@ -117,7 +117,7 @@
             try:
                 conn = db.getConnection()
                 cur = conn.cursor()
-                fields = {'filename': name}
+                fields = {'filename': name, 'case': case}
                 cur.execute(sql % fields)
                 result = cur.fetchone()
                 if result:



More information about the Mpuls-commits mailing list