From c63b585d8cd10f02acbb3cf426355dd37cccb493 Mon Sep 17 00:00:00 2001 From: Karl Hobley Date: Fri, 3 Apr 2015 17:15:22 +0100 Subject: [PATCH] Clean up W293 errors --- wagtail/contrib/wagtailstyleguide/views.py | 1 - wagtail/wagtailadmin/edit_handlers.py | 3 +-- wagtail/wagtailadmin/templatetags/wagtailuserbar.py | 2 +- wagtail/wagtailadmin/userbar.py | 4 ++-- wagtail/wagtailadmin/utils.py | 2 +- wagtail/wagtailcore/tests/test_migrations.py | 2 +- wagtail/wagtailembeds/oembed_providers.py | 2 +- wagtail/wagtailimages/tests/test_image_operations.py | 2 +- wagtail/wagtailimages/views/multiple.py | 2 +- wagtail/wagtailredirects/tests.py | 6 +++--- wagtail/wagtailsnippets/widgets.py | 2 +- 11 files changed, 13 insertions(+), 15 deletions(-) diff --git a/wagtail/contrib/wagtailstyleguide/views.py b/wagtail/contrib/wagtailstyleguide/views.py index 4b8139e6f..14f615f38 100644 --- a/wagtail/contrib/wagtailstyleguide/views.py +++ b/wagtail/contrib/wagtailstyleguide/views.py @@ -10,7 +10,6 @@ from wagtail.wagtailimages.widgets import AdminImageChooser from wagtail.wagtaildocs.widgets import AdminDocumentChooser class ExampleForm(forms.Form): - def __init__(self, *args, **kwargs): super(ExampleForm, self).__init__(*args, **kwargs) self.fields['page_chooser'].widget = AdminPageChooser() diff --git a/wagtail/wagtailadmin/edit_handlers.py b/wagtail/wagtailadmin/edit_handlers.py index 67ef7e5a4..6e1a782f8 100644 --- a/wagtail/wagtailadmin/edit_handlers.py +++ b/wagtail/wagtailadmin/edit_handlers.py @@ -724,11 +724,10 @@ Page.settings_panels = [ class BaseStreamFieldPanel(BaseFieldPanel): - def classes(self): classes = super(BaseStreamFieldPanel, self).classes() classes.append("stream-field") - + # BaseFieldPanel is essentially for single fields, which are rendered on the front end # with the assumption that the label (singular) will always be promoted to the full-width # divider bar thing. diff --git a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py index 2846d9506..b0221aabb 100644 --- a/wagtail/wagtailadmin/templatetags/wagtailuserbar.py +++ b/wagtail/wagtailadmin/templatetags/wagtailuserbar.py @@ -13,7 +13,7 @@ register = template.Library() def wagtailuserbar(context): # Find request object request = context['request'] - + # Don't render if user doesn't have permission to access the admin area if not request.user.has_perm('wagtailadmin.access_admin'): return '' diff --git a/wagtail/wagtailadmin/userbar.py b/wagtail/wagtailadmin/userbar.py index 8416255ff..e1ca0d6a5 100644 --- a/wagtail/wagtailadmin/userbar.py +++ b/wagtail/wagtailadmin/userbar.py @@ -44,7 +44,7 @@ class EditPageItem(BaseItem): # Don't render if user doesn't have permission to access the admin area if not request.user.has_perm('wagtailadmin.access_admin'): return "" - + # Don't render if the user doesn't have permission to edit this page permission_checker = self.page.permissions_for_user(request.user) if not permission_checker.can_edit(): @@ -69,7 +69,7 @@ class ModeratePageItem(BaseItem): if not self.revision.page.permissions_for_user(request.user).can_publish(): return "" - + return super(ModeratePageItem, self).render(request) class ApproveModerationEditPageItem(ModeratePageItem): diff --git a/wagtail/wagtailadmin/utils.py b/wagtail/wagtailadmin/utils.py index a5cb98a1a..6d4c64b4e 100644 --- a/wagtail/wagtailadmin/utils.py +++ b/wagtail/wagtailadmin/utils.py @@ -74,7 +74,7 @@ def send_mail(email_subject, email_content, email_addresses, from_email=None): def send_notification(page_revision_id, notification, excluded_user_id): # Get revision revision = PageRevision.objects.get(id=page_revision_id) - + # Get list of recipients if notification == 'submitted': # Get list of publishers diff --git a/wagtail/wagtailcore/tests/test_migrations.py b/wagtail/wagtailcore/tests/test_migrations.py index a8d6b39f5..2227060cc 100644 --- a/wagtail/wagtailcore/tests/test_migrations.py +++ b/wagtail/wagtailcore/tests/test_migrations.py @@ -11,7 +11,7 @@ from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.state import ProjectState from django.db.migrations.questioner import MigrationQuestioner - + class TestForMigrations(TransactionTestCase): def test__migrations(self): app_labels = set(app.label for app in apps.get_app_configs() diff --git a/wagtail/wagtailembeds/oembed_providers.py b/wagtail/wagtailembeds/oembed_providers.py index 30df31b85..ca98af98e 100644 --- a/wagtail/wagtailembeds/oembed_providers.py +++ b/wagtail/wagtailembeds/oembed_providers.py @@ -292,7 +292,7 @@ OEMBED_ENDPOINTS = { "http://www.ifttt.com/oembed/": [ "^http(?:s)?://ifttt\\.com/recipes/.+$" ], - + # Added 11th December 2014 - http://developers.issuu.com/api/oembed.html "http://issuu.com/oembed": [ "^http(?:s)?://(?:www\\.)?issuu\\.com/[^#?/]+/docs/.+$" diff --git a/wagtail/wagtailimages/tests/test_image_operations.py b/wagtail/wagtailimages/tests/test_image_operations.py index f21e4002e..5ed6d66c3 100644 --- a/wagtail/wagtailimages/tests/test_image_operations.py +++ b/wagtail/wagtailimages/tests/test_image_operations.py @@ -79,7 +79,7 @@ class ImageOperationTestCase(unittest.TestCase): test_name = 'test_run_%s' % filter_spec test_run.__name__ = test_name return test_run - + @classmethod def setup_test_methods(cls): if cls.operation_class is None: diff --git a/wagtail/wagtailimages/views/multiple.py b/wagtail/wagtailimages/views/multiple.py index 278354a17..6907c8629 100644 --- a/wagtail/wagtailimages/views/multiple.py +++ b/wagtail/wagtailimages/views/multiple.py @@ -66,7 +66,7 @@ def add(request): }, { 'file': request.FILES['files[]'], }) - + if form.is_valid(): # Save it image = form.save(commit=False) diff --git a/wagtail/wagtailredirects/tests.py b/wagtail/wagtailredirects/tests.py index 9aab1e98a..96588973f 100644 --- a/wagtail/wagtailredirects/tests.py +++ b/wagtail/wagtailredirects/tests.py @@ -96,7 +96,7 @@ class TestRedirectsAddView(TestCase, WagtailTestUtils): def get(self, params={}): return self.client.get(reverse('wagtailredirects_add_redirect'), params) - + def post(self, post_data={}): return self.client.post(reverse('wagtailredirects_add_redirect'), post_data) @@ -142,7 +142,7 @@ class TestRedirectsEditView(TestCase, WagtailTestUtils): def get(self, params={}, redirect_id=None): return self.client.get(reverse('wagtailredirects_edit_redirect', args=(redirect_id or self.redirect.id, )), params) - + def post(self, post_data={}, redirect_id=None): return self.client.post(reverse('wagtailredirects_edit_redirect', args=(redirect_id or self.redirect.id, )), post_data) @@ -190,7 +190,7 @@ class TestRedirectsDeleteView(TestCase, WagtailTestUtils): def get(self, params={}, redirect_id=None): return self.client.get(reverse('wagtailredirects_delete_redirect', args=(redirect_id or self.redirect.id, )), params) - + def post(self, post_data={}, redirect_id=None): return self.client.post(reverse('wagtailredirects_delete_redirect', args=(redirect_id or self.redirect.id, )), post_data) diff --git a/wagtail/wagtailsnippets/widgets.py b/wagtail/wagtailsnippets/widgets.py index 2766b39e2..5c176b8b3 100644 --- a/wagtail/wagtailsnippets/widgets.py +++ b/wagtail/wagtailsnippets/widgets.py @@ -10,7 +10,7 @@ from wagtail.wagtailadmin.widgets import AdminChooser class AdminSnippetChooser(AdminChooser): target_content_type = None - + def __init__(self, content_type=None, **kwargs): if 'snippet_type_name' in kwargs: snippet_type_name = kwargs.pop('snippet_type_name')