aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/moderation/forms.py
diff options
context:
space:
mode:
authortilly-Q <nattilypigeonfowl@gmail.com>2013-08-29 17:31:19 -0400
committertilly-Q <nattilypigeonfowl@gmail.com>2013-08-29 17:31:19 -0400
commit1bb367f6136ae4cbcdf6dd86af65eb613913dbd8 (patch)
treec3565801fcf21de1383b5bdb764208b3a98c8e49 /mediagoblin/moderation/forms.py
parentdfd66b789cd6cc9470c2a98bcbda9ee5e0f3ad0f (diff)
downloadmediagoblin-1bb367f6136ae4cbcdf6dd86af65eb613913dbd8.tar.lz
mediagoblin-1bb367f6136ae4cbcdf6dd86af65eb613913dbd8.tar.xz
mediagoblin-1bb367f6136ae4cbcdf6dd86af65eb613913dbd8.zip
This is a quick commit. I gave admins the ability to ban or unban users
straight from the moderation.users_detail page. I also changed the UserBan.expiration_date type from DateTime into Date. I also began work on the Terms of Service, pulled from another website (which will be cited clearly before I'm done). I added new tests as well for the ban/unbanning. Lastly, I added a few `user_not_banned` decorators to relevant views, so banned users cannot access any pages.
Diffstat (limited to 'mediagoblin/moderation/forms.py')
-rw-r--r--mediagoblin/moderation/forms.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/mediagoblin/moderation/forms.py b/mediagoblin/moderation/forms.py
index a3202359..dd5a9282 100644
--- a/mediagoblin/moderation/forms.py
+++ b/mediagoblin/moderation/forms.py
@@ -38,6 +38,15 @@ class MultiCheckboxField(wtforms.SelectMultipleField):
class PrivilegeAddRemoveForm(wtforms.Form):
privilege_name = wtforms.HiddenField('',[wtforms.validators.required()])
+class BanForm(wtforms.Form):
+ user_banned_until = wtforms.DateField(
+ _(u'User will be banned until:'),
+ format='%Y-%m-%d',
+ validators=[wtforms.validators.optional()])
+ why_user_was_banned = wtforms.TextAreaField(
+ _(u'Why are you banning this User?'),
+ validators=[wtforms.validators.optional()])
+
class ReportResolutionForm(wtforms.Form):
action_to_resolve = MultiCheckboxField(
_(u'What action will you take to resolve the report?'),