Mercurial > public > sg101
comparison gpp/forums/views/spam.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 | 2ff5f4c1476d |
comparison
equal
deleted
inserted
replaced
362:c5ae0a276e33 | 363:9d470c7a2b93 |
---|---|
35 user.save() | 35 user.save() |
36 | 36 |
37 profile = user.get_profile() | 37 profile = user.get_profile() |
38 profile.status = bio.models.STA_SPAMMER | 38 profile.status = bio.models.STA_SPAMMER |
39 profile.status_date = datetime.datetime.now() | 39 profile.status_date = datetime.datetime.now() |
40 profile.location = '' | 40 profile.reset_text_fields() |
41 profile.occupation = '' | |
42 profile.interests = '' | |
43 profile.profile_text = '' | |
44 profile.signature = '' | |
45 profile.save() | 41 profile.save() |
46 | 42 |
47 Comment.objects.filter(user=user).delete() | 43 Comment.objects.filter(user=user).delete() |
48 delete_user_posts(user) | 44 delete_user_posts(user) |
49 | 45 |