|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: roundupdb.py,v 1.120 2005-12-25 16:20:02 a1s Exp $ |
| 18 | +# $Id: roundupdb.py,v 1.121 2006-01-27 02:39:42 richard Exp $ |
19 | 19 |
|
20 | 20 | """Extending hyperdb with types specific to issue-tracking. |
21 | 21 | """ |
@@ -180,12 +180,13 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy', |
180 | 180 | list. These recipients will not be included in the To: or Cc: |
181 | 181 | address lists. |
182 | 182 | """ |
183 | | - if msgid is None: |
184 | | - authid = '1' |
185 | | - recipients = [] |
186 | | - else: |
| 183 | + if msgid: |
187 | 184 | authid = self.db.msg.get(msgid, 'author') |
188 | 185 | recipients = self.db.msg.get(msgid, 'recipients', []) |
| 186 | + else: |
| 187 | + # "system message" |
| 188 | + authid = None |
| 189 | + recipients = [] |
189 | 190 |
|
190 | 191 | sendto = [] |
191 | 192 | bcc_sendto = [] |
@@ -274,15 +275,18 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None, |
274 | 275 | title = self.get(nodeid, 'title') or '%s message copy'%cn |
275 | 276 |
|
276 | 277 | # figure author information |
277 | | - if msgid is None: |
278 | | - authid = '1' |
279 | | - authname = 'admin' |
280 | | - else: |
| 278 | + if msgid: |
281 | 279 | authid = messages.get(msgid, 'author') |
282 | 280 | authname = users.get(authid, 'realname') |
283 | | - if not authname: |
284 | | - authname = users.get(authid, 'username', '') |
285 | | - authaddr = users.get(authid, 'address', '') |
| 281 | + if not authname: |
| 282 | + authname = users.get(authid, 'username', '') |
| 283 | + authaddr = users.get(authid, 'address', '') |
| 284 | + else: |
| 285 | + # "system message" |
| 286 | + authid = None |
| 287 | + authname = 'admin' |
| 288 | + authaddr = self.db.config.ADMIN_EMAIL |
| 289 | + |
286 | 290 | if authaddr: |
287 | 291 | authaddr = " <%s>" % straddr( ('',authaddr) ) |
288 | 292 |
|
|
0 commit comments