From: jlgijsbers Date: Sat, 6 Sep 2003 20:02:23 +0000 (+0000) Subject: Move up figure_curuserid(), it should be available for all backends. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=023108807e2312810326ffce31cc1a46772dc24e;p=roundup.git Move up figure_curuserid(), it should be available for all backends. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1861 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup/backends/back_anydbm.py b/roundup/backends/back_anydbm.py index 86b2510..0eaf605 100644 --- a/roundup/backends/back_anydbm.py +++ b/roundup/backends/back_anydbm.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.125 2003-09-06 07:27:30 jlgijsbers Exp $ +#$Id: back_anydbm.py,v 1.126 2003-09-06 20:01:10 jlgijsbers Exp $ ''' This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python @@ -89,16 +89,6 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): self.reindex() self.figure_curuserid() - 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 reindex(self): for klass in self.classes.values(): for nodeid in klass.list(): diff --git a/roundup/backends/rdbms_common.py b/roundup/backends/rdbms_common.py index 1bdec79..216fce9 100644 --- a/roundup/backends/rdbms_common.py +++ b/roundup/backends/rdbms_common.py @@ -1,4 +1,4 @@ -# $Id: rdbms_common.py,v 1.60 2003-09-04 00:47:01 richard Exp $ +# $Id: rdbms_common.py,v 1.61 2003-09-06 20:01:10 jlgijsbers Exp $ ''' Relational database (SQL) backend common code. Basics: @@ -145,14 +145,7 @@ class Database(FileStorage, hyperdb.Database, roundupdb.Database): # commit self.conn.commit() - # figure 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) + self.figure_curuserid() def reindex(self): for klass in self.classes.values(): diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py index 00b6092..14e0622 100644 --- a/roundup/roundupdb.py +++ b/roundup/roundupdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.87 2003-09-06 07:27:30 jlgijsbers Exp $ +# $Id: roundupdb.py,v 1.88 2003-09-06 20:02:23 jlgijsbers Exp $ __doc__ = """ Extending hyperdb with types specific to issue-tracking. @@ -72,6 +72,16 @@ class Database: 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():