Skip to content

Commit e82017e

Browse files
author
Richard Jones
committed
handle missing addresses on users [SF#724537]
1 parent b4fccab commit e82017e

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ are given with the most recent entry first.
1212
- email file attachments added to issue files list (sf bug 711501)
1313
- added socket timeout to attempt to prevent stuck processes (sf bug 665487)
1414
- email registered users shouldn't be able to log in (sf bug 714673)
15+
- handle missing addresses on users (sf bug 724537)
1516

1617

1718
2003-02-27 0.5.6

roundup/roundupdb.py

Lines changed: 17 additions & 10 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.75 2002-12-11 01:52:20 richard Exp $
18+
# $Id: roundupdb.py,v 1.75.2.1 2003-04-27 02:29:07 richard Exp $
1919

2020
__doc__ = """
2121
Extending hyperdb with types specific to issue-tracking.
@@ -110,9 +110,16 @@ def nosymessage(self, nodeid, msgid, oldvalues):
110110

111111
# possibly send the message to the author, as long as they aren't
112112
# anonymous
113-
if (self.db.config.MESSAGES_TO_AUTHOR == 'yes' and
114-
users.get(authid, 'username') != 'anonymous'):
115-
sendto.append(authid)
113+
if (users.get(authid, 'username') != 'anonymous' and
114+
not r.has_key(authid)):
115+
if self.db.config.MESSAGES_TO_AUTHOR == 'yes':
116+
# make sure they have an address
117+
add = users.get(authid, 'address')
118+
if add:
119+
# send it to them
120+
sendto.append(add)
121+
recipients.append(authid)
122+
116123
r[authid] = 1
117124

118125
# now figure the nosy people who weren't recipients
@@ -125,9 +132,12 @@ def nosymessage(self, nodeid, msgid, oldvalues):
125132
continue
126133
# make sure they haven't seen the message already
127134
if not r.has_key(nosyid):
128-
# send it to them
129-
sendto.append(nosyid)
130-
recipients.append(nosyid)
135+
# make sure they have an address
136+
add = users.get(nosyid, 'address')
137+
if add:
138+
# send it to them
139+
sendto.append(add)
140+
recipients.append(nosyid)
131141

132142
# generate a change note
133143
if oldvalues:
@@ -137,9 +147,6 @@ def nosymessage(self, nodeid, msgid, oldvalues):
137147

138148
# we have new recipients
139149
if sendto:
140-
# map userids to addresses
141-
sendto = [users.get(i, 'address') for i in sendto]
142-
143150
# update the message's recipients list
144151
messages.set(msgid, recipients=recipients)
145152

0 commit comments

Comments
 (0)