Mercurial > p > roundup > code
diff roundup/roundupdb.py @ 1800:a3b1b1dcf639
Use getuid(), not figure_curuserid()
- Extended getuid() to replace figure_curuserid().
- Replace all references to curuserid with calls to getuid().
- Changed the docs to point to always point to getuid() and mention the change
in upgrading.txt.
| author | Johannes Gijsbers <jlgijsbers@users.sourceforge.net> |
|---|---|
| date | Mon, 08 Sep 2003 20:39:18 +0000 |
| parents | 071ea6fc803f |
| children | 6f3b92a817aa |
line wrap: on
line diff
--- a/roundup/roundupdb.py Mon Sep 08 09:28:28 2003 +0000 +++ b/roundup/roundupdb.py Mon Sep 08 20:39:18 2003 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.89 2003-09-08 09:28:28 jlgijsbers Exp $ +# $Id: roundupdb.py,v 1.90 2003-09-08 20:39:18 jlgijsbers Exp $ __doc__ = """ Extending hyperdb with types specific to issue-tracking. @@ -35,7 +35,13 @@ def getuid(self): """Return the id of the "user" node associated with the user that owns this connection to the hyperdatabase.""" - return self.user.lookup(self.journaltag) + if self.journaltag is None: + return None + elif self.journaltag == 'admin': + # admin user may not exist, but always has ID 1 + return '1' + else: + return self.user.lookup(self.journaltag) def getUserTimezone(self): """Return user timezone defined in 'timezone' property of user class. @@ -51,16 +57,6 @@ timezone = 0 return timezone - def figure_curuserid(self): - """Figure out the 'curuserid'.""" - if self.journaltag is None: - self.curuserid = None - elif self.journaltag == 'admin': - # admin user may not exist, but always has ID 1 - self.curuserid = '1' - else: - self.curuserid = self.user.lookup(self.journaltag) - def confirm_registration(self, otk): props = self.otks.getall(otk) for propname, proptype in self.user.getprops().items(): @@ -77,7 +73,6 @@ # tag new user creation with 'admin' self.journaltag = 'admin' - self.figure_curuserid() # create the new user cl = self.user
