Permalink
Browse files

catch object does not exist exception if trying to get profile and no…

…ne exists

git-svn-id: https://django-notification.googlecode.com/svn/trunk@93 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
1 parent 02250bd commit dd198e1925c261e82348369f10abdb76baf4fc0b @jtauber jtauber committed Sep 2, 2008
Showing with 3 additions and 1 deletion.
  1. +3 −1 notification/models.py
@@ -6,6 +6,8 @@
from django.template import Context
from django.template.loader import render_to_string
+from django.core.exceptions import ObjectDoesNotExist
+
from django.contrib.sites.models import Site
from django.contrib.auth.models import User, SiteProfileNotAvailable
@@ -216,7 +218,7 @@ def send(recipient, label, extra_context={}, issue_notice=True):
# get user profiles if available
try:
profile = user.get_profile()
- except (SiteProfileNotAvailable, AttributeError):
+ except (SiteProfileNotAvailable, AttributeError, ObjectDoesNotExist):
profile = None
# activate language of user to send message translated

0 comments on commit dd198e1

Please sign in to comment.