From cdd6d44b52799f16f3267284d29d5694a0d730c6 Mon Sep 17 00:00:00 2001 From: richard Date: Sun, 27 Apr 2003 02:29:08 +0000 Subject: [PATCH] handle missing addresses on users (sf bug 724537) git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1688 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 1 + roundup/roundupdb.py | 40 ++++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ef60af1..925026e 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -88,6 +88,7 @@ Fixed: - fixed missing (pre-commit) journal entries in *dbm backends (sf bug 679217) - URL cited in roundup email confusing dumb Email clients (sf bug 716585) - set title on issues even when the email body is empty (sf bug 727430) +- handle missing addresses on users (sf bug 724537) 2003-??-?? 0.5.7 diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py index 56176a9..e596743 100644 --- a/roundup/roundupdb.py +++ b/roundup/roundupdb.py @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: roundupdb.py,v 1.85 2003-04-24 07:19:58 richard Exp $ +# $Id: roundupdb.py,v 1.86 2003-04-27 02:24:37 richard Exp $ __doc__ = """ Extending hyperdb with types specific to issue-tracking. @@ -133,23 +133,27 @@ class IssueClass: # anonymous if (users.get(authid, 'username') != 'anonymous' and not r.has_key(authid)): - if self.db.config.MESSAGES_TO_AUTHOR == 'yes': - # always CC the author of the message - sendto.append(authid) - recipients.append(authid) - elif self.db.config.MESSAGES_TO_AUTHOR == 'new' and not oldvalues: - # only CC the author if the issue is new - sendto.append(authid) - recipients.append(authid) + if (self.db.config.MESSAGES_TO_AUTHOR == 'yes' or + (self.db.config.MESSAGES_TO_AUTHOR == 'new' and not oldvalues)): + # 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 deal with cc people. for cc_userid in cc : if r.has_key(cc_userid): continue - # send it to them - sendto.append(cc_userid) - recipients.append(cc_userid) + # make sure they have an address + add = users.get(cc_userid, 'address') + if add: + # send it to them + sendto.append(add) + recipients.append(cc_userid) # now figure the nosy people who weren't recipients nosy = self.get(nodeid, whichnosy) @@ -161,9 +165,12 @@ class IssueClass: 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: @@ -173,9 +180,6 @@ class IssueClass: # 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) -- 2.30.2