[Mpuls-commits] r2940 - in base/trunk: . mpulsweb/model
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jun 9 12:47:34 CEST 2010
Author: bh
Date: 2010-06-09 12:47:32 +0200 (Wed, 09 Jun 2010)
New Revision: 2940
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/model/user.py
Log:
* mpulsweb/model/user.py (UserObject.setData): The login name from
the data argument is the short login name stored in self.login,
not the full database login name for self.full_login. Change the
code accordingly and document the treatment of the login name in
this method.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-06-09 10:31:04 UTC (rev 2939)
+++ base/trunk/ChangeLog 2010-06-09 10:47:32 UTC (rev 2940)
@@ -1,5 +1,13 @@
2010-06-09 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/model/user.py (UserObject.setData): The login name from
+ the data argument is the short login name stored in self.login,
+ not the full database login name for self.full_login. Change the
+ code accordingly and document the treatment of the login name in
+ this method.
+
+2010-06-09 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/model/user.py (SessionSuperAdmin.__init__): Remove line
that should have been removed with the change to use parse_dblogin
Modified: base/trunk/mpulsweb/model/user.py
===================================================================
--- base/trunk/mpulsweb/model/user.py 2010-06-09 10:31:04 UTC (rev 2939)
+++ base/trunk/mpulsweb/model/user.py 2010-06-09 10:47:32 UTC (rev 2940)
@@ -536,12 +536,23 @@
self.telephone = data.get('telephone', self.telephone)
self.room = data.get('room', self.room)
self.branchoffice = data.get('branchoffice', self.branchoffice)
- self.full_login = data.get('login', self.full_login)
- tok = self.full_login.split('_')
- self.login = "_".join(tok[2:])
self.activated = data.get('activated', self.activated)
self.needs_passrefresh = data.get('newpass', self.needs_passrefresh)
+ # FIXME: data only contains the login for the web-application,
+ # but not he full login for the database. Therefore we only set
+ # self.login and set self.full_login to an empty string, since
+ # we cannot really set that here. Furthermore, given the way
+ # this method is actually used, the login name doesn't even
+ # matter here anyway: after calling setData the caller always
+ # calls either createLogin, in which case the login name is
+ # given explicitly to createLogin again, or the caller calls
+ # store, where the login name is not used at all, because it
+ # cannot be changed for existing users. Afterwards, the
+ # userobject is not used again.
+ self.login = data.get('login', self.login)
+ self.full_login = ''
+
def createLogin(self, login=None, role=None, agency=None):
self.login = login
self.role = role
More information about the Mpuls-commits
mailing list