[Mpuls-commits] r2848 - in base/trunk: . mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Jun 1 12:48:37 CEST 2010


Author: bh
Date: 2010-06-01 12:48:36 +0200 (Tue, 01 Jun 2010)
New Revision: 2848

Modified:
   base/trunk/ChangeLog
   base/trunk/mpulsweb/controllers/administration.py
Log:
* mpulsweb/controllers/administration.py
(AdministrationController.newUserAction)
(AdministrationController.editUserGroupAction): Instantiate
ValidatorStateObject so that the new instance is used as the
state, not the class itself.  When using the class instead of a
new instance all threads will effectively share the same state,
which leads to races.


Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog	2010-05-31 18:18:08 UTC (rev 2847)
+++ base/trunk/ChangeLog	2010-06-01 10:48:36 UTC (rev 2848)
@@ -1,3 +1,13 @@
+2010-06-01  Bernhard Herzog  <bh at intevation.de>
+
+	* mpulsweb/controllers/administration.py
+	(AdministrationController.newUserAction)
+	(AdministrationController.editUserGroupAction): Instantiate
+	ValidatorStateObject so that the new instance is used as the
+	state, not the class itself.  When using the class instead of a
+	new instance all threads will effectively share the same state,
+	which leads to races.
+
 2010-05-31  Bernhard Herzog  <bh at intevation.de>
 
 	* mpulsweb/lib/db.py (db): Get rid of one more "waska" reference:

Modified: base/trunk/mpulsweb/controllers/administration.py
===================================================================
--- base/trunk/mpulsweb/controllers/administration.py	2010-05-31 18:18:08 UTC (rev 2847)
+++ base/trunk/mpulsweb/controllers/administration.py	2010-06-01 10:48:36 UTC (rev 2848)
@@ -103,7 +103,7 @@
         c.user_password = None
         try:
             agency = getDbName()
-            state = ValidatorStateObject
+            state = ValidatorStateObject()
             state.agency = agency
             c.form_result = validator.to_python(request.params, state)
             c.uo = UserObject()
@@ -400,7 +400,7 @@
         c.userlist = userlist.getUserList(filter=[u.id for u in admins])
 
         try:
-            state = ValidatorStateObject
+            state = ValidatorStateObject()
             data = formencode.variabledecode.variable_decode(request.params)
             state.groupid = data.get('id')
             form_result = validator.to_python(data, state)



More information about the Mpuls-commits mailing list