[Mpuls-commits] r5688 - base/trunk/mpulsweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Dec 2 11:56:59 CET 2011
Author: ludwig
Date: 2011-12-02 11:56:59 +0100 (Fri, 02 Dec 2011)
New Revision: 5688
Modified:
base/trunk/mpulsweb/controllers/casedocument.py
base/trunk/mpulsweb/controllers/document.py
Log:
Issue 2732 Bugfix: Work on _check_filename.
No longer add an X if name stays the same.
Modified: base/trunk/mpulsweb/controllers/casedocument.py
===================================================================
--- base/trunk/mpulsweb/controllers/casedocument.py 2011-12-02 10:46:16 UTC (rev 5687)
+++ base/trunk/mpulsweb/controllers/casedocument.py 2011-12-02 10:56:59 UTC (rev 5688)
@@ -160,7 +160,7 @@
desc = result['description']
else:
desc = ""
- while not self._check_filename(filename):
+ while not self._check_filename(filename, id):
filename += "X"
renameDocument(id, filename, desc, True)
except formencode.Invalid, error:
@@ -174,9 +174,9 @@
errors=c.form_errors)
return self.overview(session['case'].id)
- def _check_filename(self, name):
+ def _check_filename(self, name, id):
found_other = False
for doc in session['document_files']:
- if int(doc[0]) != id and doc[1] == name:
+ if int(doc[0]) != int(id) and doc[1] == name:
found_other = True
return not found_other
Modified: base/trunk/mpulsweb/controllers/document.py
===================================================================
--- base/trunk/mpulsweb/controllers/document.py 2011-12-02 10:46:16 UTC (rev 5687)
+++ base/trunk/mpulsweb/controllers/document.py 2011-12-02 10:56:59 UTC (rev 5688)
@@ -182,7 +182,7 @@
desc = result['description']
else:
desc = ""
- while not self._check_filename(filename):
+ while not self._check_filename(filename, id):
filename += "X"
renameDocument(id, filename, desc)
except formencode.Invalid, error:
@@ -196,10 +196,10 @@
errors=c.form_errors)
return self.globalOverview()
- def _check_filename(self, name):
+ def _check_filename(self, name, id):
found_other = False
for doc in session['document_files']:
- if int(doc[0]) != id and doc[1] == name:
+ if int(doc[0]) != int(id) and doc[1] == name:
found_other = True
return not found_other
More information about the Mpuls-commits
mailing list