diff roundup/backends/back_metakit.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 d2801a2b0a77
children 91a4619b1a14
line wrap: on
line diff
--- a/roundup/backends/back_metakit.py	Mon Sep 08 09:28:28 2003 +0000
+++ b/roundup/backends/back_metakit.py	Mon Sep 08 20:39:18 2003 +0000
@@ -1,4 +1,4 @@
-# $Id: back_metakit.py,v 1.49 2003-09-04 00:47:01 richard Exp $
+# $Id: back_metakit.py,v 1.50 2003-09-08 20:39:18 jlgijsbers Exp $
 '''
    Metakit backend for Roundup, originally by Gordon McMillan.
 
@@ -48,10 +48,6 @@
         _dbs[config.DATABASE] = db
     else:
         db.journaltag = journaltag
-        try:
-            delattr(db, 'curuserid')
-        except AttributeError:
-            pass
     return db
 
 class _Database(hyperdb.Database, roundupdb.Database):
@@ -81,21 +77,7 @@
 
     # --- defined in ping's spec
     def __getattr__(self, classname):
-        if classname == 'curuserid':
-            if self.journaltag is None:
-                return None
-
-            # try to set the curuserid from the journaltag
-            try:
-                x = int(self.classes['user'].lookup(self.journaltag))
-                self.curuserid = x
-            except KeyError:
-                if self.journaltag == 'admin':
-                    self.curuserid = x = 1
-                else:
-                    x = 0
-            return x
-        elif classname == 'transactions':
+        if classname == 'transactions':
             return self.dirty
         # fall back on the classes
         return self.getclass(classname)
@@ -154,7 +136,7 @@
         if tblid == -1:
             tblid = self.tables.append(name=tablenm)
         if creator is None:
-            creator = self.curuserid
+            creator = self.getuid()
         else:
             try:
                 creator = int(creator)
@@ -642,7 +624,7 @@
             if not row.creation:
                 row.creation = int(time.time())
             if not row.creator:
-                row.creator = self.db.curuserid
+                row.creator = self.db.getuid()
 
         self.db.dirty = 1
         if self.do_journal:

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