1515# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717#
18- # $Id: roundupdb.py,v 1.113 2004-10-08 01:58:43 richard Exp $
18+ # $Id: roundupdb.py,v 1.114 2004-10-08 05:44:33 richard Exp $
1919
2020"""Extending hyperdb with types specific to issue-tracking.
2121"""
@@ -169,8 +169,12 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
169169 list. These recipients will not be included in the To: or Cc:
170170 address lists.
171171 """
172- authid = self .db .msg .safeget (msgid , 'author' )
173- recipients = self .db .msg .safeget (msgid , 'recipients' , [])
172+ if msgid is None :
173+ authid = '1'
174+ recipients = []
175+ else :
176+ authid = self .db .msg .get (msgid , 'author' )
177+ recipients = self .db .msg .get (msgid , 'recipients' , [])
174178
175179 sendto = []
176180 bcc_sendto = []
@@ -237,8 +241,12 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
237241 messages = self .db .msg
238242 files = self .db .file
239243
240- inreplyto = messages .safeget (msgid , 'inreplyto' )
241- messageid = messages .safeget (msgid , 'messageid' )
244+ if msgid is None :
245+ inreplyto = None
246+ messageid = None
247+ else :
248+ authid = messages .get (msgid , 'inreplyto' )
249+ recipients = messages .get (msgid , 'messageid' )
242250
243251 # make up a messageid if there isn't one (web edit)
244252 if not messageid :
@@ -255,11 +263,15 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
255263 title = self .get (nodeid , 'title' ) or '%s message copy' % cn
256264
257265 # figure author information
258- authid = messages .safeget (msgid , 'author' )
259- authname = users .safeget (authid , 'realname' )
266+ if msgid is None :
267+ authid = '1'
268+ authname = 'admin'
269+ else :
270+ authid = messages .get (msgid , 'author' )
271+ authname = users .get (authid , 'realname' )
260272 if not authname :
261- authname = users .safeget (authid , 'username' , '' )
262- authaddr = users .safeget (authid , 'address' , '' )
273+ authname = users .get (authid , 'username' , '' )
274+ authaddr = users .get (authid , 'address' , '' )
263275 if authaddr :
264276 authaddr = " <%s>" % straddr ( ('' ,authaddr ) )
265277
@@ -281,7 +293,8 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None,
281293 m .append ('' )
282294
283295 # add the content
284- m .append (messages .safeget (msgid , 'content' , '' ))
296+ if msgid is not None :
297+ m .append (messages .get (msgid , 'content' , '' ))
285298
286299 # add the change note
287300 if note :
0 commit comments