comparison gpp/bio/admin.py @ 348:d1b11096595b

Fix #168; when nailing a spammer, clear their profile text fields. Guard against topics and forums that don't exist when deleting posts in the signal handler. Make the forum stats template tag only display the latest active users.
author Brian Neal <bgneal@gmail.com>
date Wed, 02 Mar 2011 02:18:28 +0000
parents 69d0306a6fe7
children 9d470c7a2b93
comparison
equal deleted inserted replaced
347:69d0306a6fe7 348:d1b11096595b
96 """ 96 """
97 self.mark_user_status(request, qs, bio.models.STA_SPAMMER) 97 self.mark_user_status(request, qs, bio.models.STA_SPAMMER)
98 for profile in qs: 98 for profile in qs:
99 Comment.objects.filter(user=profile.user).delete() 99 Comment.objects.filter(user=profile.user).delete()
100 delete_user_posts(profile.user) 100 delete_user_posts(profile.user)
101 profile.location = ''
102 profile.occupation = ''
103 profile.interests = ''
104 profile.profile_text = ''
105 profile.signature = ''
106 profile.save()
101 mark_spammer.short_description = "Mark selected users as spammers" 107 mark_spammer.short_description = "Mark selected users as spammers"
102 108
103 def mark_stranger(self, request, qs): 109 def mark_stranger(self, request, qs):
104 """ 110 """
105 Marks users as strangers. Updates their profile status to STA_STRANGER. 111 Marks users as strangers. Updates their profile status to STA_STRANGER.