1414# FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS"
1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
17- #
18- # $Id: roundupdb.py,v 1.109 2004-07-02 05:22:08 richard Exp $
17+ #
18+ # $Id: roundupdb.py,v 1.110 2004-07-02 08:27:56 a1s Exp $
1919
2020"""Extending hyperdb with types specific to issue-tracking.
2121"""
@@ -53,8 +53,8 @@ def getUserTimezone(self):
5353 try :
5454 timezone = int (self .user .get (userid , 'timezone' ))
5555 except (KeyError , ValueError , TypeError ):
56- # If there is no class 'user' or current user doesn't have timezone
57- # property or that property is not numeric assume he/she lives in
56+ # If there is no class 'user' or current user doesn't have timezone
57+ # property or that property is not numeric assume he/she lives in
5858 # Greenwich :)
5959 timezone = getattr (self .config , 'DEFAULT_TIMEZONE' , 0 )
6060 return timezone
@@ -78,13 +78,13 @@ def confirm_registration(self, otk):
7878
7979 # create the new user
8080 cl = self .user
81-
81+
8282 props ['roles' ] = self .config .NEW_WEB_USER_ROLES
8383 userid = cl .create (** props )
8484 # clear the props from the otk database
8585 self .getOTKManager ().destroy (otk )
8686 self .commit ()
87-
87+
8888 return userid
8989
9090
@@ -107,6 +107,18 @@ class IssueClass:
107107 - superseder = hyperdb.Multilink(classname)
108108 """
109109
110+ # The tuple below does not affect the class definition.
111+ # It just lists all names of all issue properties
112+ # marked for message extraction tool.
113+ #
114+ # XXX is there better way to get property names into message catalog??
115+ #
116+ # Note that this list also includes properties
117+ # defined in the classic template:
118+ # assignedto, topic, priority, status.
119+ ('' "title" , '' "messages" , '' "files" , '' "nosy" , '' "superseder" ,
120+ '' "assignedto" , '' "topic" , '' "priority" , '' "status" )
121+
110122 # New methods:
111123 def addmessage (self , nodeid , summary , text ):
112124 """Add a message to an issue's mail spool.
@@ -127,7 +139,7 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
127139
128140 The message is sent only to users on the nosy list who are not
129141 already on the "recipients" list for the message.
130-
142+
131143 These users are then added to the message's "recipients" list.
132144
133145 If 'msgid' is None, the message gets sent only to the nosy
@@ -144,7 +156,7 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
144156 """
145157 authid = self .db .msg .safeget (msgid , 'author' )
146158 recipients = self .db .msg .safeget (msgid , 'recipients' , [])
147-
159+
148160 sendto = []
149161 bcc_sendto = []
150162 seen_message = {}
@@ -171,14 +183,14 @@ def good_recipient(userid):
171183 (self .db .config .MESSAGES_TO_AUTHOR == 'yes' or
172184 (self .db .config .MESSAGES_TO_AUTHOR == 'new' and not oldvalues ))):
173185 add_recipient (authid , sendto )
174-
186+
175187 if authid :
176188 seen_message [authid ] = 1
177-
189+
178190 # now deal with the nosy and cc people who weren't recipients.
179191 for userid in cc + self .get (nodeid , whichnosy ):
180192 if good_recipient (userid ):
181- add_recipient (userid , sendto )
193+ add_recipient (userid , sendto )
182194
183195 # now deal with bcc people.
184196 for userid in bcc :
@@ -209,7 +221,7 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
209221 users = self .db .user
210222 messages = self .db .msg
211223 files = self .db .file
212-
224+
213225 inreplyto = messages .safeget (msgid , 'inreplyto' )
214226 messageid = messages .safeget (msgid , 'messageid' )
215227
@@ -351,7 +363,7 @@ def email_signature(self, nodeid, msgid):
351363 '''
352364 # simplistic check to see if the url is valid,
353365 # then append a trailing slash if it is missing
354- base = self .db .config .TRACKER_WEB
366+ base = self .db .config .TRACKER_WEB
355367 if (not isinstance (base , type ('' )) or
356368 not (base .startswith ('http://' ) or base .startswith ('https://' ))):
357369 web = "Configuration Error: TRACKER_WEB isn't a " \
0 commit comments