Skip to content

Commit 7dc0a93

Browse files
author
Richard Jones
committed
handle missing addresses on users [SF#724537]
1 parent cb4b4ea commit 7dc0a93

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Fixed:
8888
- fixed missing (pre-commit) journal entries in *dbm backends (sf bug 679217)
8989
- URL cited in roundup email confusing dumb Email clients (sf bug 716585)
9090
- set title on issues even when the email body is empty (sf bug 727430)
91+
- handle missing addresses on users (sf bug 724537)
9192

9293

9394
2003-??-?? 0.5.7

roundup/roundupdb.py

Lines changed: 22 additions & 18 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: roundupdb.py,v 1.85 2003-04-24 07:19:58 richard Exp $
18+
# $Id: roundupdb.py,v 1.86 2003-04-27 02:24:37 richard Exp $
1919

2020
__doc__ = """
2121
Extending hyperdb with types specific to issue-tracking.
@@ -133,23 +133,27 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
133133
# anonymous
134134
if (users.get(authid, 'username') != 'anonymous' and
135135
not r.has_key(authid)):
136-
if self.db.config.MESSAGES_TO_AUTHOR == 'yes':
137-
# always CC the author of the message
138-
sendto.append(authid)
139-
recipients.append(authid)
140-
elif self.db.config.MESSAGES_TO_AUTHOR == 'new' and not oldvalues:
141-
# only CC the author if the issue is new
142-
sendto.append(authid)
143-
recipients.append(authid)
136+
if (self.db.config.MESSAGES_TO_AUTHOR == 'yes' or
137+
(self.db.config.MESSAGES_TO_AUTHOR == 'new' and not oldvalues)):
138+
# make sure they have an address
139+
add = users.get(authid, 'address')
140+
if add:
141+
# send it to them
142+
sendto.append(add)
143+
recipients.append(authid)
144+
144145
r[authid] = 1
145146

146147
# now deal with cc people.
147148
for cc_userid in cc :
148149
if r.has_key(cc_userid):
149150
continue
150-
# send it to them
151-
sendto.append(cc_userid)
152-
recipients.append(cc_userid)
151+
# make sure they have an address
152+
add = users.get(cc_userid, 'address')
153+
if add:
154+
# send it to them
155+
sendto.append(add)
156+
recipients.append(cc_userid)
153157

154158
# now figure the nosy people who weren't recipients
155159
nosy = self.get(nodeid, whichnosy)
@@ -161,9 +165,12 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
161165
continue
162166
# make sure they haven't seen the message already
163167
if not r.has_key(nosyid):
164-
# send it to them
165-
sendto.append(nosyid)
166-
recipients.append(nosyid)
168+
# make sure they have an address
169+
add = users.get(nosyid, 'address')
170+
if add:
171+
# send it to them
172+
sendto.append(add)
173+
recipients.append(nosyid)
167174

168175
# generate a change note
169176
if oldvalues:
@@ -173,9 +180,6 @@ def nosymessage(self, nodeid, msgid, oldvalues, whichnosy='nosy',
173180

174181
# we have new recipients
175182
if sendto:
176-
# map userids to addresses
177-
sendto = [users.get(i, 'address') for i in sendto]
178-
179183
# update the message's recipients list
180184
messages.set(msgid, recipients=recipients)
181185

0 commit comments

Comments
 (0)