diff options
author | Michael Elkins <melkins@tislabs.com> | 2012-08-24 20:36:50 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2012-08-24 20:36:50 +0000 |
commit | 72395ab40f21eb5f6fd4371c0d076e84a35ad266 (patch) | |
tree | 3b16ade1357a2c1a0858899fccc6e75422517684 | |
parent | 7a0beac41cae1b98eac4752bd9e263491c1b7f98 (diff) |
do not assume that user.email is not None
svn path=/trunk/; revision=4660
-rw-r--r-- | rpkid/portal-gui/scripts/rpkigui-check-expired.py | 7 | ||||
-rw-r--r-- | rpkid/rpki/gui/app/glue.py | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/rpkid/portal-gui/scripts/rpkigui-check-expired.py b/rpkid/portal-gui/scripts/rpkigui-check-expired.py index 616c573c..c996b181 100644 --- a/rpkid/portal-gui/scripts/rpkigui-check-expired.py +++ b/rpkid/portal-gui/scripts/rpkigui-check-expired.py @@ -190,9 +190,10 @@ for h in qs: if options.email: notify_emails = get_email_list(h) - t = """This is an automated notice about the upcoming expiration of RPKI resources for the handle %s on %s. You are receiving this notification because your email address is either registered in a Ghostbuster record, or as the default email address for the account.\n\n""" % (h.handle, host) + if notify_emails: + t = """This is an automated notice about the upcoming expiration of RPKI resources for the handle %s on %s. You are receiving this notification because your email address is either registered in a Ghostbuster record, or as the default email address for the account.\n\n""" % (h.handle, host) - send_mail(subject='RPKI expiration notice for %s' % h.handle, - message=t + s, from_email=from_email, recipient_list=notify_emails) + send_mail(subject='RPKI expiration notice for %s' % h.handle, + message=t + s, from_email=from_email, recipient_list=notify_emails) sys.exit(0) diff --git a/rpkid/rpki/gui/app/glue.py b/rpkid/rpki/gui/app/glue.py index 8edc6b04..6d168b26 100644 --- a/rpkid/rpki/gui/app/glue.py +++ b/rpkid/rpki/gui/app/glue.py @@ -149,6 +149,7 @@ def get_email_list(conf): if len(notify_emails) == 0: # fall back to the email address registered for this user user = User.objects.get(username=conf.handle) - notify_emails.append(user.email) + if user.email: + notify_emails.append(user.email) return notify_emails |