Mercurial > public > sg101
diff gpp/forums/tools.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 | 767cedc7d12a |
children | e0523e17ea43 |
line wrap: on
line diff
--- a/gpp/forums/tools.py Wed Mar 02 01:11:32 2011 +0000 +++ b/gpp/forums/tools.py Wed Mar 02 02:18:28 2011 +0000 @@ -52,7 +52,7 @@ else: forum.last_post = None forum.save() - + # Delete pending topics now because forums have just adjusted their # foreign keys into Post if pending_delete: @@ -63,7 +63,7 @@ for forum in forums: forum.topic_count = Topic.objects.filter(forum=forum).count() forum.save() - + # All foreign keys are accounted for, we can now delete the posts in bulk. # Since some posts in our original queryset may have been deleted already, # run a new query (although it may be ok)