Skip to content

Commit

Permalink
Don't throw exception when approving a blog with no name
Browse files Browse the repository at this point in the history
  • Loading branch information
mhagander committed Sep 24, 2011
1 parent 53505f9 commit acb3211
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hamnadmin/register/admin.py
Expand Up @@ -12,12 +12,16 @@ class Meta:
def clean_approved(self):
if self.cleaned_data['approved'] != self.instance.approved:
# Approved flag has changed, send an email
if self.cleaned_data.has_key('name'):
name = self.cleaned_data['name']
else:
name = "<empty>"
send_mail('A planet blog has been %s' % (
self.cleaned_data['approved'] and 'approved' or 'de-approved',
),
"The blog %s (for user %s, userid %s) has been %s." % (
self.cleaned_data['feedurl'],
self.cleaned_data['name'],
name,
self.cleaned_data['userid'],
self.cleaned_data['approved'] and 'approved' or 'de-approved',
), 'webmaster@postgresql.org', [settings.NOTIFYADDR])
Expand Down

0 comments on commit acb3211

Please sign in to comment.