diff gpp/forums/forms.py @ 460:2ff5f4c1476d

Fixing #221. Found some additional cases where the forum moderator check was failing. Replaced this code with calls to the new permissions module.
author Brian Neal <bgneal@gmail.com>
date Sun, 03 Jul 2011 19:35:09 +0000
parents 26fc9ac9a0eb
children 3b30286adba5
line wrap: on
line diff
--- a/gpp/forums/forms.py	Sat Jul 02 23:35:45 2011 +0000
+++ b/gpp/forums/forms.py	Sun Jul 03 19:35:09 2011 +0000
@@ -8,6 +8,7 @@
 from forums.models import Topic
 from forums.models import Post
 from forums.attachments import AttachmentProcessor
+import forums.permissions as perms
 
 
 class NewPostForm(forms.Form):
@@ -85,7 +86,7 @@
         self.user = user
         self.forum = forum
 
-        if user.is_superuser or user in forum.moderators.all():
+        if perms.can_moderate(forum, user):
             self.fields['sticky'] = forms.BooleanField(required=False)
             self.fields['locked'] = forms.BooleanField(required=False)
             self.has_mod_fields = True