summaryrefslogtreecommitdiff
path: root/pgcommitfest/commitfest/management/commands/send_notifications.py
diff options
context:
space:
mode:
Diffstat (limited to 'pgcommitfest/commitfest/management/commands/send_notifications.py')
-rw-r--r--pgcommitfest/commitfest/management/commands/send_notifications.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pgcommitfest/commitfest/management/commands/send_notifications.py b/pgcommitfest/commitfest/management/commands/send_notifications.py
index 634af58..6a8fe42 100644
--- a/pgcommitfest/commitfest/management/commands/send_notifications.py
+++ b/pgcommitfest/commitfest/management/commands/send_notifications.py
@@ -5,6 +5,7 @@ from django.conf import settings
from StringIO import StringIO
from pgcommitfest.commitfest.models import PendingNotification
+from pgcommitfest.userprofile.models import UserProfile
from pgcommitfest.mailqueue.util import send_template_mail
class Command(BaseCommand):
@@ -27,8 +28,11 @@ class Command(BaseCommand):
for v in matches.values():
user = v['user']
email = user.email
- if user.userprofile and user.userprofile.notifyemail:
- email = user.userprofile.notifyemail.email
+ try:
+ if user.userprofile and user.userprofile.notifyemail:
+ email = user.userprofile.notifyemail.email
+ except UserProfile.DoesNotExist:
+ pass
send_template_mail(settings.NOTIFICATION_FROM,
None,