aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2012-08-31 20:06:36 +0000
committerRob Austein <sra@hactrn.net>2012-08-31 20:06:36 +0000
commit916ed6d39316f3f217df830e7802a34bb5261c82 (patch)
treeba4723240d765735d959b33269c8cda98e17b6d5
parentbcb677739cb95386073038a97ae09397148bcc07 (diff)
Merge from trunk.
svn path=/branches/tk274/; revision=4681
-rw-r--r--rpkid/portal-gui/scripts/rpkigui-check-expired.py7
-rw-r--r--rpkid/rpki/gui/app/glue.py3
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