Skip to content

Commit 1be6854

Browse files
author
Johannes Gijsbers
committed
Move up figure_curuserid(), it should be available for all backends.
1 parent 3d09410 commit 1be6854

File tree

3 files changed

+14
-21
lines changed

3 files changed

+14
-21
lines changed

roundup/backends/back_anydbm.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
#$Id: back_anydbm.py,v 1.125 2003-09-06 07:27:30 jlgijsbers Exp $
18+
#$Id: back_anydbm.py,v 1.126 2003-09-06 20:01:10 jlgijsbers Exp $
1919
'''
2020
This module defines a backend that saves the hyperdatabase in a database
2121
chosen by anydbm. It is guaranteed to always be available in python
@@ -89,16 +89,6 @@ def post_init(self):
8989
self.reindex()
9090
self.figure_curuserid()
9191

92-
def figure_curuserid(self):
93-
"""Figure out the 'curuserid'."""
94-
if self.journaltag is None:
95-
self.curuserid = None
96-
elif self.journaltag == 'admin':
97-
# admin user may not exist, but always has ID 1
98-
self.curuserid = '1'
99-
else:
100-
self.curuserid = self.user.lookup(self.journaltag)
101-
10292
def reindex(self):
10393
for klass in self.classes.values():
10494
for nodeid in klass.list():

roundup/backends/rdbms_common.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.60 2003-09-04 00:47:01 richard Exp $
1+
# $Id: rdbms_common.py,v 1.61 2003-09-06 20:01:10 jlgijsbers Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -145,14 +145,7 @@ def post_init(self):
145145
# commit
146146
self.conn.commit()
147147

148-
# figure the "curuserid"
149-
if self.journaltag is None:
150-
self.curuserid = None
151-
elif self.journaltag == 'admin':
152-
# admin user may not exist, but always has ID 1
153-
self.curuserid = '1'
154-
else:
155-
self.curuserid = self.user.lookup(self.journaltag)
148+
self.figure_curuserid()
156149

157150
def reindex(self):
158151
for klass in self.classes.values():

roundup/roundupdb.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: roundupdb.py,v 1.87 2003-09-06 07:27:30 jlgijsbers Exp $
18+
# $Id: roundupdb.py,v 1.88 2003-09-06 20:02:23 jlgijsbers Exp $
1919

2020
__doc__ = """
2121
Extending hyperdb with types specific to issue-tracking.
@@ -72,6 +72,16 @@ def getUserTimezone(self):
7272
timezone = 0
7373
return timezone
7474

75+
def figure_curuserid(self):
76+
"""Figure out the 'curuserid'."""
77+
if self.journaltag is None:
78+
self.curuserid = None
79+
elif self.journaltag == 'admin':
80+
# admin user may not exist, but always has ID 1
81+
self.curuserid = '1'
82+
else:
83+
self.curuserid = self.user.lookup(self.journaltag)
84+
7585
def confirm_registration(self, otk):
7686
props = self.otks.getall(otk)
7787
for propname, proptype in self.user.getprops().items():

0 commit comments

Comments
 (0)