diff antispam/utils.py @ 608:8ddd6490cbc9

Follow up to c8b4dfb2d1e5; delete spammer's avatar if it exists.
author Brian Neal <bgneal@gmail.com>
date Thu, 26 Jul 2012 14:18:10 -0500
parents c8b4dfb2d1e5
children 08d905e38a86
line wrap: on
line diff
--- a/antispam/utils.py	Wed Jul 25 19:40:36 2012 -0500
+++ b/antispam/utils.py	Thu Jul 26 14:18:10 2012 -0500
@@ -80,7 +80,8 @@
     profile.status = STA_SPAMMER
     profile.status_date = datetime.datetime.now()
     profile.reset_text_fields()
-    profile.avatar.delete(save=False)
+    if profile.avatar:
+        profile.avatar.delete(save=False)
     profile.save()
 
     Comment.objects.filter(user=user).delete()