diff --git a/src/postorius/fieldset_forms.py b/src/postorius/fieldset_forms.py
index bb2bb00..3972de6 100644
--- a/src/postorius/fieldset_forms.py
+++ b/src/postorius/fieldset_forms.py
@@ -48,12 +48,12 @@
def as_div(self):
"""Render the form as a set of
s."""
output = ""
- #Adding Errors
+ # Adding Errors
try:
output += str(self.errors["NON_FIELD_ERRORS"])
except:
pass
- #create the fieldsets
+ # Create the fieldsets
for index in range(len(self.layout)):
output += self.create_fieldset(self.layout[index])
return safestring.mark_safe(output)
diff --git a/src/postorius/forms.py b/src/postorius/forms.py
index 75f7f65..c0ff959 100644
--- a/src/postorius/forms.py
+++ b/src/postorius/forms.py
@@ -1,4 +1,4 @@
-#-*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
# Copyright (C) 2012-2014 by the Free Software Foundation, Inc.
#
# This file is part of Postorius.
@@ -421,11 +421,11 @@
# 'invalid': _('Please provide an integer.'),
# },
# required=False,
- #)
+ # )
# no_reply_address = forms.EmailField(
# label=_('No reply address'),
# required=False,
- #)
+ # )
posting_pipeline = forms.CharField(
label=_('Pipeline'),
help_text=(
@@ -437,7 +437,7 @@
# 'invalid': _('Please provide an integer.'),
# },
# required=False,
- #)
+ # )
display_name = forms.CharField(
label=_('Display name'),
help_text=('Display name is the name shown in the web interface.')
@@ -725,9 +725,9 @@
choices = ((True, _('Yes')), (False, _('No')))
delivery_mode_choices = (("regular", _('Regular')),
- ("plaintext_digests", _('Plain Text Digests')),
- ("mime_digests", _('Mime Digests')),
- ("summary_digests", _('Summary Digests')))
+ ("plaintext_digests", _('Plain Text Digests')),
+ ("mime_digests", _('Mime Digests')),
+ ("summary_digests", _('Summary Digests')))
delivery_status_choices = (
("enabled", _('Enabled')), ("by_user", _('Disabled')))
delivery_status = forms.ChoiceField(
diff --git a/src/postorius/urls.py b/src/postorius/urls.py
index 6c35912..df63a87 100644
--- a/src/postorius/urls.py
+++ b/src/postorius/urls.py
@@ -69,7 +69,8 @@
url(r'^held_messages$',
'list_held_messages',
name='list_held_messages'),
- url(r'^remove/(?P
[^/]+)/(?P[^/]+)',
+ url(r'^remove/(?P[^/]+)/'
+ '(?P[^/]+)',
'remove_role', name='remove_role'),
url(r'^settings/(?P[^/]+)?'
'(?:/(?P.*))?$',
diff --git a/src/postorius/views/generic.py b/src/postorius/views/generic.py
index f2c3357..f523837 100644
--- a/src/postorius/views/generic.py
+++ b/src/postorius/views/generic.py
@@ -37,6 +37,7 @@
self._client = utils.get_client()
return self._client
+
class MailingListView(TemplateView, MailmanClientMixin):
"""A generic view for everything based on a mailman.client
@@ -99,7 +100,8 @@
user_obj = None
# replace display_name with first address if display_name is not set
if user_obj is not None:
- if user_obj.display_name == 'None' or user_obj.display_name is None:
+ if (user_obj.display_name == 'None' or
+ user_obj.display_name is None):
user_obj.display_name = ''
user_obj.first_address = self._get_first_address(user_obj)
return user_obj
@@ -136,7 +138,6 @@
self.mm_user = self._get_user(user_id)
except MailmanApiError:
return utils.render_api_error(request)
-
# set the template
if 'template' in kwargs:
diff --git a/src/postorius/views/list.py b/src/postorius/views/list.py
index 95a51f2..5605773 100644
--- a/src/postorius/views/list.py
+++ b/src/postorius/views/list.py
@@ -97,6 +97,7 @@
'moderator_form': moderator_form},
context_instance=RequestContext(request))
+
class ListMemberOptionsView(MailingListView):
'''View the preferences for a single member of a mailing list'''
@@ -127,7 +128,7 @@
'postorius/lists/memberoptions.html',
{'mm_member': mm_member,
'settingsform': settingsform,
- },
+ },
context_instance=RequestContext(request))
@method_decorator(list_owner_required)
@@ -146,9 +147,10 @@
'postorius/lists/memberoptions.html',
{'mm_member': mm_member,
'settingsform': settingsform,
- },
+ },
context_instance=RequestContext(request))
+
class ListMetricsView(MailingListView):
"""Shows common list metrics.
@@ -362,7 +364,8 @@
the_list = List.objects.get_or_404(fqdn_listname=fqdn_listname)
except AttributeError, e:
return render_to_response('postorius/errors/generic.html',
- {'error': "Mailman REST API not available. Please start Mailman core."},
+ {'error': 'Mailman REST API not available.'
+ ' Please start Mailman core.'},
context_instance=RequestContext(request))
# process submitted form
if request.method == 'POST':
@@ -619,11 +622,13 @@
if role == 'owner':
if address not in the_list.owners:
- messages.error(request, _('The user {} is not an owner'.format(address)))
+ messages.error(request,
+ _('The user {} is not an owner'.format(address)))
return redirect("list_members", the_list.fqdn_listname)
elif role == 'moderator':
if address not in the_list.moderators:
- messages.error(request, _('The user {} is not a moderator'.format(address)))
+ messages.error(request,
+ _('The user {} is not a moderator'.format(address)))
return redirect("list_members", the_list.fqdn_listname)
if request.method == 'POST':
@@ -636,10 +641,11 @@
' {1}'.format(role, e.msg)))
return redirect("list_members", the_list.fqdn_listname)
messages.success(request,
- _('The user {0} has been removed as {1}.'.format(address, role)))
+ _('The user {0} has been removed as {1}.'
+ .format(address, role)))
return redirect("list_members", the_list.fqdn_listname)
return render_to_response(template,
- {'role': role, 'address': address,
+ {'role': role, 'address': address,
'fqdn_listname': the_list.fqdn_listname},
context_instance=RequestContext(request))
diff --git a/src/postorius/views/user.py b/src/postorius/views/user.py
index 22e26ee..f9430f4 100644
--- a/src/postorius/views/user.py
+++ b/src/postorius/views/user.py
@@ -119,7 +119,7 @@
@method_decorator(login_required)
def get(self, request):
try:
- helperform=UserPreferences()
+ helperform = UserPreferences()
mm_user = MailmanUser.objects.get(address=request.user.email)
addresses = mm_user.addresses
i = 0
@@ -140,7 +140,7 @@
return render_to_response('postorius/user_address_preferences.html',
{'mm_user': mm_user,
'addresses': addresses,
- 'helperform':helperform,
+ 'helperform': helperform,
'formset': formset,
'zipped_data': zipped_data},
context_instance=RequestContext(request))
@@ -202,6 +202,7 @@
'formset': formset},
context_instance=RequestContext(request))
+
class UserSummaryView(MailmanUserView):
"""Shows a summary of a user.
@@ -316,13 +317,16 @@
@login_required
-def more_info_tab(request, formid=None, helpid=None, template='postorius/more_info_display.html'):
+def more_info_tab(request, formid=None, helpid=None,
+ template='postorius/more_info_display.html'):
"""Displays more_info in new tab.
"""
if(formid == 'list_settings'):
form = ListSettings(
- visible_section='List Identity', visible_option='None', data=request.POST)
+ visible_section='List Identity',
+ visible_option='None',
+ data=request.POST)
for field in form:
if field.name == helpid: