diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index ddaf4dd2979b3ca4a3b0770a38213e600648a0d8..d59d41e64e8970f2d37d0c42a49331b0e00fa615 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.99 2004-02-29 00:35:55 richard Exp $
+# $Id: roundupdb.py,v 1.106 2004-04-05 06:13:42 richard Exp $
"""Extending hyperdb with types specific to issue-tracking.
"""
# If there is no class 'user' or current user doesn't have timezone
# property or that property is not numeric assume he/she lives in
# Greenwich :)
- timezone = 0
+ timezone = getattr(self.config, 'DEFAULT_TIMEZONE', 0)
return timezone
def confirm_registration(self, otk):
- props = self.otks.getall(otk)
+ props = self.getOTKManager().getall(otk)
for propname, proptype in self.user.getprops().items():
value = props.get(propname, None)
if value is None:
cl = self.user
props['roles'] = self.config.NEW_WEB_USER_ROLES
- del props['__time']
userid = cl.create(**props)
# clear the props from the otk database
- self.otks.destroy(otk)
+ self.getOTKManager().destroy(otk)
self.commit()
return userid
if address:
sendto.append(address)
recipients.append(userid)
-
+
def good_recipient(userid):
# Make sure we don't send mail to either the anonymous
# user or a user who has already seen the message.
return (userid and
(self.db.user.get(userid, 'username') != 'anonymous') and
not seen_message.has_key(userid))
-
+
# possibly send the message to the author, as long as they aren't
# anonymous
if (good_recipient(authid) and
base = self.db.config.TRACKER_WEB
if (not isinstance(base , type('')) or
not (base.startswith('http://') or base.startswith('https://'))):
- base = "Configuration Error: TRACKER_WEB isn't a " \
+ web = "Configuration Error: TRACKER_WEB isn't a " \
"fully-qualified URL"
- elif base[-1] != '/' :
- base += '/'
- web = base + self.classname + nodeid
+ else:
+ if not base.endswith('/'):
+ base = base + '/'
+ web = base + self.classname + nodeid
# ensure the email address is properly quoted
email = straddr((self.db.config.TRACKER_NAME,
self.db.config.TRACKER_EMAIL))
line = '_' * max(len(web)+2, len(email))
- return '%s\n%s\n<%s>\n%s'%(line, email, web, line)
+ return '\n%s\n%s\n<%s>\n%s'%(line, email, web, line)
def generateCreateNote(self, nodeid):
for key in oldvalues.keys():
if key in ['files','messages']:
continue
- if key in ('activity', 'creator', 'creation'):
+ if key in ('actor', 'activity', 'creator', 'creation'):
continue
# not all keys from oldvalues might be available in database
# this happens when property was deleted