comparison 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
comparison
equal deleted inserted replaced
607:34b1dd3f84fa 608:8ddd6490cbc9
78 78
79 profile = user.get_profile() 79 profile = user.get_profile()
80 profile.status = STA_SPAMMER 80 profile.status = STA_SPAMMER
81 profile.status_date = datetime.datetime.now() 81 profile.status_date = datetime.datetime.now()
82 profile.reset_text_fields() 82 profile.reset_text_fields()
83 profile.avatar.delete(save=False) 83 if profile.avatar:
84 profile.avatar.delete(save=False)
84 profile.save() 85 profile.save()
85 86
86 Comment.objects.filter(user=user).delete() 87 Comment.objects.filter(user=user).delete()
87 delete_user_posts(user) 88 delete_user_posts(user)
88 89