comparison gpp/bio/admin.py @ 363:9d470c7a2b93

Following up on #168; redo some code to make it more DRY. Added a function on the profile to reset the text fields.
author Brian Neal <bgneal@gmail.com>
date Sat, 05 Mar 2011 04:03:30 +0000
parents d1b11096595b
children 701730b2fcda
comparison
equal deleted inserted replaced
362:c5ae0a276e33 363:9d470c7a2b93
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 = '' 101 profile.reset_text_fields()
102 profile.occupation = ''
103 profile.interests = ''
104 profile.profile_text = ''
105 profile.signature = ''
106 profile.save() 102 profile.save()
107 mark_spammer.short_description = "Mark selected users as spammers" 103 mark_spammer.short_description = "Mark selected users as spammers"
108 104
109 def mark_stranger(self, request, qs): 105 def mark_stranger(self, request, qs):
110 """ 106 """