Browse Source

tiny code cleanups

Rafał Pitoń 8 years ago
parent
commit
1ce547fe0c

+ 9 - 9
misago/users/permissions/account.py

@@ -14,24 +14,24 @@ class PermissionsForm(forms.Form):
     name_changes_allowed = forms.IntegerField(
     name_changes_allowed = forms.IntegerField(
         label=_("Allowed username changes number"),
         label=_("Allowed username changes number"),
         min_value=0,
         min_value=0,
-        initial=1)
+        initial=1
+    )
     name_changes_expire = forms.IntegerField(
     name_changes_expire = forms.IntegerField(
         label=_("Don't count username changes older than"),
         label=_("Don't count username changes older than"),
         help_text=_("Number of days since name change that makes "
         help_text=_("Number of days since name change that makes "
                     "that change no longer count to limit. Enter "
                     "that change no longer count to limit. Enter "
                     "zero to make all changes count."),
                     "zero to make all changes count."),
         min_value=0,
         min_value=0,
-        initial=0)
-    can_have_signature = forms.YesNoSwitch(
-        label=_("Can have signature"))
-    allow_signature_links = forms.YesNoSwitch(
-        label=_("Can put links in signature"))
-    allow_signature_images = forms.YesNoSwitch(
-        label=_("Can put images in signature"))
+        initial=0
+    )
+    can_have_signature = forms.YesNoSwitch(label=_("Can have signature"))
+    allow_signature_links = forms.YesNoSwitch(label=_("Can put links in signature"))
+    allow_signature_images = forms.YesNoSwitch(label=_("Can put images in signature"))
     allow_signature_blocks = forms.YesNoSwitch(
     allow_signature_blocks = forms.YesNoSwitch(
         label=_("Can use text blocks in signature"),
         label=_("Can use text blocks in signature"),
         help_text=_("Controls whether or not users can put quote, code, "
         help_text=_("Controls whether or not users can put quote, code, "
-                    "spoiler blocks and horizontal lines in signatures."))
+                    "spoiler blocks and horizontal lines in signatures.")
+    )
 
 
 
 
 def change_permissions_form(role):
 def change_permissions_form(role):

+ 4 - 2
misago/users/permissions/delete.py

@@ -22,12 +22,14 @@ class PermissionsForm(forms.Form):
         label=_("Maximum age of deleted account (in days)"),
         label=_("Maximum age of deleted account (in days)"),
         help_text=_("Enter zero to disable this check."),
         help_text=_("Enter zero to disable this check."),
         min_value=0,
         min_value=0,
-        initial=0)
+        initial=0
+    )
     can_delete_users_with_less_posts_than = forms.IntegerField(
     can_delete_users_with_less_posts_than = forms.IntegerField(
         label=_("Maximum number of posts on deleted account"),
         label=_("Maximum number of posts on deleted account"),
         help_text=_("Enter zero to disable this check."),
         help_text=_("Enter zero to disable this check."),
         min_value=0,
         min_value=0,
-        initial=0)
+        initial=0
+    )
 
 
 
 
 def change_permissions_form(role):
 def change_permissions_form(role):

+ 5 - 4
misago/users/permissions/moderation.py

@@ -22,20 +22,21 @@ class PermissionsForm(forms.Form):
 
 
     can_rename_users = forms.YesNoSwitch(label=_("Can rename users"))
     can_rename_users = forms.YesNoSwitch(label=_("Can rename users"))
     can_moderate_avatars = forms.YesNoSwitch(label=_("Can moderate avatars"))
     can_moderate_avatars = forms.YesNoSwitch(label=_("Can moderate avatars"))
-    can_moderate_signatures = forms.YesNoSwitch(
-        label=_("Can moderate signatures"))
+    can_moderate_signatures = forms.YesNoSwitch(label=_("Can moderate signatures"))
     can_ban_users = forms.YesNoSwitch(label=_("Can ban users"))
     can_ban_users = forms.YesNoSwitch(label=_("Can ban users"))
     max_ban_length = forms.IntegerField(
     max_ban_length = forms.IntegerField(
         label=_("Max length, in days, of imposed ban"),
         label=_("Max length, in days, of imposed ban"),
         help_text=_("Enter zero to let moderators impose permanent bans."),
         help_text=_("Enter zero to let moderators impose permanent bans."),
         min_value=0,
         min_value=0,
-        initial=0)
+        initial=0
+    )
     can_lift_bans = forms.YesNoSwitch(label=_("Can lift bans"))
     can_lift_bans = forms.YesNoSwitch(label=_("Can lift bans"))
     max_lifted_ban_length = forms.IntegerField(
     max_lifted_ban_length = forms.IntegerField(
         label=_("Max length, in days, of lifted ban"),
         label=_("Max length, in days, of lifted ban"),
         help_text=_("Enter zero to let moderators lift permanent bans."),
         help_text=_("Enter zero to let moderators lift permanent bans."),
         min_value=0,
         min_value=0,
-        initial=0)
+        initial=0
+    )
 
 
 
 
 def change_permissions_form(role):
 def change_permissions_form(role):

+ 18 - 10
misago/users/permissions/profiles.py

@@ -15,16 +15,19 @@ Admin Permissions Form
 """
 """
 CAN_BROWSE_USERS_LIST = forms.YesNoSwitch(
 CAN_BROWSE_USERS_LIST = forms.YesNoSwitch(
     label=_("Can browse users list"),
     label=_("Can browse users list"),
-    initial=1)
+    initial=1
+)
 CAN_SEARCH_USERS = forms.YesNoSwitch(
 CAN_SEARCH_USERS = forms.YesNoSwitch(
     label=_("Can search user profiles"),
     label=_("Can search user profiles"),
-    initial=1)
+    initial=1
+)
 CAN_SEE_USER_NAME_HISTORY = forms.YesNoSwitch(
 CAN_SEE_USER_NAME_HISTORY = forms.YesNoSwitch(
-    label=_("Can see other members name history"))
+    label=_("Can see other members name history")
+)
 CAN_SEE_BAN_DETAILS = forms.YesNoSwitch(
 CAN_SEE_BAN_DETAILS = forms.YesNoSwitch(
     label=_("Can see members bans details"),
     label=_("Can see members bans details"),
-    help_text=_("Allows users with this permission to see user and "
-                "staff ban messages."))
+    help_text=_("Allows users with this permission to see user and staff ban messages.")
+)
 
 
 
 
 class LimitedPermissionsForm(forms.Form):
 class LimitedPermissionsForm(forms.Form):
@@ -42,18 +45,23 @@ class PermissionsForm(LimitedPermissionsForm):
     can_search_users = CAN_SEARCH_USERS
     can_search_users = CAN_SEARCH_USERS
     can_follow_users = forms.YesNoSwitch(
     can_follow_users = forms.YesNoSwitch(
         label=_("Can follow other users"),
         label=_("Can follow other users"),
-        initial=1)
+        initial=1
+    )
     can_be_blocked = forms.YesNoSwitch(
     can_be_blocked = forms.YesNoSwitch(
         label=_("Can be blocked by other users"),
         label=_("Can be blocked by other users"),
-        initial=0)
+        initial=0
+    )
     can_see_users_name_history = CAN_SEE_USER_NAME_HISTORY
     can_see_users_name_history = CAN_SEE_USER_NAME_HISTORY
     can_see_ban_details = CAN_SEE_BAN_DETAILS
     can_see_ban_details = CAN_SEE_BAN_DETAILS
     can_see_users_emails = forms.YesNoSwitch(
     can_see_users_emails = forms.YesNoSwitch(
-        label=_("Can see members e-mails"))
+        label=_("Can see members e-mails")
+    )
     can_see_users_ips = forms.YesNoSwitch(
     can_see_users_ips = forms.YesNoSwitch(
-        label=_("Can see members IPs"))
+        label=_("Can see members IPs")
+    )
     can_see_hidden_users = forms.YesNoSwitch(
     can_see_hidden_users = forms.YesNoSwitch(
-        label=_("Can see members that hide their presence"))
+        label=_("Can see members that hide their presence")
+    )
 
 
 
 
 def change_permissions_form(role):
 def change_permissions_form(role):

+ 5 - 4
misago/users/permissions/warnings.py

@@ -20,8 +20,7 @@ NO_OWNED_ALL = ((0, _("No")), (1, _("Owned")), (2, _("All")))
 class LimitedPermissionsForm(forms.Form):
 class LimitedPermissionsForm(forms.Form):
     legend = _("Warnings")
     legend = _("Warnings")
 
 
-    can_see_other_users_warnings = forms.YesNoSwitch(
-        label=_("Can see other users warnings"))
+    can_see_other_users_warnings = forms.YesNoSwitch(label=_("Can see other users warnings"))
 
 
 
 
 class PermissionsForm(LimitedPermissionsForm):
 class PermissionsForm(LimitedPermissionsForm):
@@ -31,12 +30,14 @@ class PermissionsForm(LimitedPermissionsForm):
         label=_("Can cancel warnings"),
         label=_("Can cancel warnings"),
         coerce=int,
         coerce=int,
         choices=NO_OWNED_ALL,
         choices=NO_OWNED_ALL,
-        initial=0)
+        initial=0
+    )
     can_delete_warnings = forms.TypedChoiceField(
     can_delete_warnings = forms.TypedChoiceField(
         label=_("Can delete warnings"),
         label=_("Can delete warnings"),
         coerce=int,
         coerce=int,
         choices=NO_OWNED_ALL,
         choices=NO_OWNED_ALL,
-        initial=0)
+        initial=0
+    )
 
 
 
 
 def change_permissions_form(role):
 def change_permissions_form(role):