Mercurial > p > roundup > code
changeset 1621:0b30d6f0ec24 maint-0.5
handle missing addresses on users [SF#724537]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 27 Apr 2003 02:29:08 +0000 |
| parents | 6d1af2e441f4 |
| children | 1bad1538f8d2 |
| files | CHANGES.txt roundup/roundupdb.py |
| diffstat | 2 files changed, 18 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Thu Apr 24 07:51:52 2003 +0000 +++ b/CHANGES.txt Sun Apr 27 02:29:08 2003 +0000 @@ -12,6 +12,7 @@ - email file attachments added to issue files list (sf bug 711501) - added socket timeout to attempt to prevent stuck processes (sf bug 665487) - email registered users shouldn't be able to log in (sf bug 714673) +- handle missing addresses on users (sf bug 724537) 2003-02-27 0.5.6
--- a/roundup/roundupdb.py Thu Apr 24 07:51:52 2003 +0000 +++ b/roundup/roundupdb.py Sun Apr 27 02:29:08 2003 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.75 2002-12-11 01:52:20 richard Exp $ +# $Id: roundupdb.py,v 1.75.2.1 2003-04-27 02:29:07 richard Exp $ __doc__ = """ Extending hyperdb with types specific to issue-tracking. @@ -110,9 +110,16 @@ # possibly send the message to the author, as long as they aren't # anonymous - if (self.db.config.MESSAGES_TO_AUTHOR == 'yes' and - users.get(authid, 'username') != 'anonymous'): - sendto.append(authid) + if (users.get(authid, 'username') != 'anonymous' and + not r.has_key(authid)): + if self.db.config.MESSAGES_TO_AUTHOR == 'yes': + # make sure they have an address + add = users.get(authid, 'address') + if add: + # send it to them + sendto.append(add) + recipients.append(authid) + r[authid] = 1 # now figure the nosy people who weren't recipients @@ -125,9 +132,12 @@ continue # make sure they haven't seen the message already if not r.has_key(nosyid): - # send it to them - sendto.append(nosyid) - recipients.append(nosyid) + # make sure they have an address + add = users.get(nosyid, 'address') + if add: + # send it to them + sendto.append(add) + recipients.append(nosyid) # generate a change note if oldvalues: @@ -137,9 +147,6 @@ # we have new recipients if sendto: - # map userids to addresses - sendto = [users.get(i, 'address') for i in sendto] - # update the message's recipients list messages.set(msgid, recipients=recipients)
