diff roundup/roundupdb.py @ 1794:2724d14f0c42

Move up figure_curuserid(), it should be available for all backends.
author Johannes Gijsbers <jlgijsbers@users.sourceforge.net>
date Sat, 06 Sep 2003 20:02:23 +0000
parents c8614db86be2
children 071ea6fc803f
line wrap: on
line diff
--- a/roundup/roundupdb.py	Sat Sep 06 10:37:11 2003 +0000
+++ b/roundup/roundupdb.py	Sat Sep 06 20:02:23 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.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 @@
             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():

Roundup Issue Tracker: http://roundup-tracker.org/