]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
trivial: Apply ruff fixes
authorStephen Finucane <stephen@that.guru>
Tue, 16 Jan 2024 21:54:20 +0000 (21:54 +0000)
committerStephen Finucane <stephen@that.guru>
Tue, 16 Jan 2024 21:58:30 +0000 (21:58 +0000)
Signed-off-by: Stephen Finucane <stephen@that.guru>
29 files changed:
manage.py
patchwork/api/check.py
patchwork/forms.py
patchwork/management/commands/cron.py
patchwork/management/commands/parsemail.py
patchwork/migrations/0001_squashed_0040_add_related_patches.py
patchwork/migrations/0007_move_comment_content_to_patch_content.py
patchwork/migrations/0010_migrate_data_from_submission_to_patch.py
patchwork/migrations/0020_tag_show_column.py
patchwork/migrations/0024_patch_patch_project.py
patchwork/migrations/0035_project_list_archive_url_format.py
patchwork/migrations/0041_python3.py
patchwork/models.py
patchwork/parser.py
patchwork/templatetags/patch.py
patchwork/tests/api/test_event.py
patchwork/tests/api/test_patch.py
patchwork/tests/api/utils.py
patchwork/tests/runner.py
patchwork/tests/test_parser.py
patchwork/tests/views/test_user.py
patchwork/tests/views/test_utils.py
patchwork/tests/views/test_xmlrpc.py
patchwork/views/__init__.py
patchwork/views/bundle.py
patchwork/views/mail.py
patchwork/views/patch.py
patchwork/views/utils.py
patchwork/views/xmlrpc.py

index d94e61187318099dc754c9453c38f1fdc9868c05..a2f4bd33bd4706897e1d31b282a190ec86c8fbd6 100755 (executable)
--- a/manage.py
+++ b/manage.py
@@ -2,9 +2,9 @@
 import os
 import sys
 
-if __name__ == "__main__":
+if __name__ == '__main__':
     os.environ.setdefault(
-        "DJANGO_SETTINGS_MODULE", "patchwork.settings.production"
+        'DJANGO_SETTINGS_MODULE', 'patchwork.settings.production'
     )
 
     import django
index 348111ae793a23d2413a0db2cd46a815171c1963..74bbc19e007881a8b89595434d9c75064dca0dc5 100644 (file)
@@ -36,7 +36,7 @@ class CheckSerializer(HyperlinkedModelSerializer):
 
     def run_validation(self, data):
         if 'state' not in data or data['state'] == '':
-            raise ValidationError({'state': ["A check must have a state."]})
+            raise ValidationError({'state': ['A check must have a state.']})
 
         for val, label in Check.STATE_CHOICES:
             if label != data['state']:
index 688fb1a0c29a04250869c8c3eab2ce31c1cc51ea..ed06d0d15070db9c2957fd120d27f3a084937fca 100644 (file)
@@ -65,7 +65,7 @@ class BundleForm(forms.ModelForm):
         min_length=1,
         max_length=50,
         label='Name',
-        error_messages={'invalid': 'Bundle names can\'t contain slashes'},
+        error_messages={'invalid': "Bundle names can't contain slashes"},
     )
 
     class Meta:
@@ -203,7 +203,7 @@ class MultiplePatchForm(forms.Form):
         opts = instance.__class__._meta
         if self.errors:
             raise ValueError(
-                "The %s could not be changed because the data "
+                'The %s could not be changed because the data '
                 "didn't validate." % opts.object_name
             )
         data = self.cleaned_data
index 225755363ce237e999f17b58040d58c2d715d085..a006d7d68dd2cb041400d7193def4b8d09e3e408 100644 (file)
@@ -19,7 +19,7 @@ class Command(BaseCommand):
         errors = send_notifications()
         for recipient, error in errors:
             self.stderr.write(
-                "Failed sending to %s: %s" % (recipient.email, error)
+                'Failed sending to %s: %s' % (recipient.email, error)
             )
 
         expire_notifications()
index 6f45f51d54eefebc56fedeb8d1b7d2cfbb79c08b..bcb257fe971421720acbb41dcbed1f7bc2265b37 100644 (file)
@@ -44,7 +44,7 @@ class Command(base.BaseCommand):
                 logger.info('Parsing mail loaded from stdin')
                 mail = email.message_from_binary_file(sys.stdin.buffer)
         except AttributeError:
-            logger.warning("Broken email ignored")
+            logger.warning('Broken email ignored')
             return
 
         # it's important to get exit codes correct here. The key is to allow
index 270ad348b8172fc21c857a087eec08dbe8631978..27752c8ec9eaeb0efe083a7936c080e47715ffc4 100644 (file)
@@ -248,8 +248,8 @@ class Migration(migrations.Migration):
                     models.CharField(
                         blank=True,
                         help_text=b"URL format for the list archive's "
-                        b"Message-ID redirector. {} will be "
-                        b"replaced by the Message-ID.",
+                        b'Message-ID redirector. {} will be '
+                        b'replaced by the Message-ID.',
                         max_length=2000,
                     ),
                 ),
@@ -424,7 +424,7 @@ class Migration(migrations.Migration):
                     models.BooleanField(
                         default=True,
                         help_text=b"Show a column displaying this tag's count "
-                        b"in the patch list view",
+                        b'in the patch list view',
                     ),
                 ),
             ],
index 89d080cbfc89569d9a5348697894138b1a714cac..1dab2c3541317179aafd2edea750b7428ef43775 100644 (file)
@@ -4,22 +4,22 @@ from django.db import connection, migrations
 def copy_comment_field(apps, schema_editor):
     if connection.vendor == 'postgresql':
         schema_editor.execute(
-            '''
+            """
             UPDATE patchwork_patch
               SET content = patchwork_comment.content
             FROM patchwork_comment
               WHERE patchwork_patch.id=patchwork_comment.patch_id
                     AND patchwork_patch.msgid=patchwork_comment.msgid
-        '''
+        """
         )
     elif connection.vendor == 'mysql':
         schema_editor.execute(
-            '''
+            """
             UPDATE patchwork_patch, patchwork_comment
               SET patchwork_patch.content = patchwork_comment.content
             WHERE patchwork_patch.id=patchwork_comment.patch_id
               AND patchwork_patch.msgid=patchwork_comment.msgid
-        '''
+        """
         )
     else:
         Comment = apps.get_model('patchwork', 'Comment')
@@ -41,21 +41,21 @@ def copy_comment_field(apps, schema_editor):
 def remove_duplicate_comments(apps, schema_editor):
     if connection.vendor == 'postgresql':
         schema_editor.execute(
-            '''
+            """
             DELETE FROM patchwork_comment
               USING patchwork_patch
               WHERE patchwork_patch.id=patchwork_comment.patch_id
                     AND patchwork_patch.msgid=patchwork_comment.msgid
-        '''
+        """
         )
     elif connection.vendor == 'mysql':
         schema_editor.execute(
-            '''
+            """
             DELETE FROM patchwork_comment
               USING patchwork_patch, patchwork_comment
               WHERE patchwork_patch.id=patchwork_comment.patch_id
                     AND patchwork_patch.msgid=patchwork_comment.msgid
-        '''
+        """
         )
     else:
         Comment = apps.get_model('patchwork', 'Comment')
index 32282285bb23a2bec9685a002745b5fba8198927..a1afaaffe3e8ba934d6407c3dcc05cd012011d6a 100644 (file)
@@ -8,19 +8,19 @@ class Migration(migrations.Migration):
 
     operations = [
         migrations.RunSQL(
-            '''INSERT INTO patchwork_patch
+            """INSERT INTO patchwork_patch
                   (submission_ptr_id, diff2, commit_ref2, pull_url2,
                    delegate2_id, state2_id, archived2, hash2)
                 SELECT id, diff, commit_ref, pull_url, delegate_id, state_id,
                        archived, hash
                 FROM patchwork_submission
-                ''',
-            '''UPDATE patchwork_submission SET
+                """,
+            """UPDATE patchwork_submission SET
                   diff=diff2, commit_ref=commit_ref2, pull_url=pull_url2,
                   delegate_id=delegate2_id, state_id=state2_id,
                   archived=archived2, hash=hash2
                 FROM patchwork_patch WHERE
                   patchwork_submission.id = patchwork_patch.submission_ptr_id
-                ''',
+                """,
         ),
     ]
index 10ce3b7870eeb3963417da0113f5f48357269cf6..e23da102ca33a7d79c18f3b0a01e93d9760c684a 100644 (file)
@@ -13,7 +13,7 @@ class Migration(migrations.Migration):
             field=models.BooleanField(
                 default=True,
                 help_text=b"Show a column displaying this tag's count in the "
-                b"patch list view",
+                b'patch list view',
             ),
         ),
     ]
index 8df51917b4379977f454195760324546dd291010..34f9c4250003056b3e801124b005db1fb1659004 100644 (file)
@@ -26,10 +26,10 @@ class Migration(migrations.Migration):
         ),
         # as with 10, this will break if you use non-default table names
         migrations.RunSQL(
-            '''UPDATE patchwork_patch SET patch_project_id =
+            """UPDATE patchwork_patch SET patch_project_id =
                                (SELECT project_id FROM patchwork_submission
                                 WHERE patchwork_submission.id =
-                                        patchwork_patch.submission_ptr_id);'''
+                                        patchwork_patch.submission_ptr_id);"""
         ),
         migrations.AlterField(
             model_name='patch',
index 005e5a4eecb98a2b754ad0f2b369721a628a8ce1..cbb3c40d3bb1fa0085151e2ad06958093da5d436 100644 (file)
@@ -13,8 +13,8 @@ class Migration(migrations.Migration):
             field=models.CharField(
                 blank=True,
                 help_text=b"URL format for the list archive's Message-ID "
-                b"redirector. {} will be replaced by the "
-                b"Message-ID.",
+                b'redirector. {} will be replaced by the '
+                b'Message-ID.',
                 max_length=2000,
             ),
         ),
index 874fea8ad20f7f3dcdc8c45b7a89767e86cdb6fa..37643bafabe2b58549a70beb5773edfff9d39fdd 100644 (file)
@@ -229,7 +229,7 @@ class Migration(migrations.Migration):
                     field=models.CharField(
                         blank=True,
                         help_text="URL format for the list archive's Message-ID "
-                        "redirector. {} will be replaced by the Message-ID.",
+                        'redirector. {} will be replaced by the Message-ID.',
                         max_length=2000,
                     ),
                 ),
@@ -314,7 +314,7 @@ class Migration(migrations.Migration):
                     field=models.BooleanField(
                         default=True,
                         help_text="Show a column displaying this tag's count in the "
-                        "patch list view",
+                        'patch list view',
                     ),
                 ),
                 migrations.AlterField(
index 422ac51d7e56145369157c2e573b6486dd5b47e0..9a619bc566b4fb85dbc2255fee25d0209b955a67 100644 (file)
@@ -88,7 +88,7 @@ class Project(models.Model):
         max_length=2000,
         blank=True,
         help_text="URL format for the list archive's Message-ID redirector. "
-        "{} will be replaced by the Message-ID.",
+        '{} will be replaced by the Message-ID.',
     )
     commit_url_format = models.CharField(
         max_length=2000,
@@ -270,7 +270,7 @@ class Tag(models.Model):
     )
     show_column = models.BooleanField(
         help_text='Show a column displaying this'
-        ' tag\'s count in the patch list view',
+        " tag's count in the patch list view",
         default=True,
     )
 
@@ -319,10 +319,10 @@ class PatchQuerySet(models.query.QuerySet):
 
         for tag in tags:
             select[tag.attr_name] = (
-                "coalesce("
-                "(SELECT count FROM patchwork_patchtag"
-                " WHERE patchwork_patchtag.patch_id=patchwork_patch.id"
-                " AND patchwork_patchtag.tag_id=%s), 0)"
+                'coalesce('
+                '(SELECT count FROM patchwork_patchtag'
+                ' WHERE patchwork_patchtag.patch_id=patchwork_patch.id'
+                ' AND patchwork_patchtag.tag_id=%s), 0)'
             )
             select_params.append(tag.id)
 
index 15ac5a1543e984429fc23e5b05ed64eb23d5a230..09a53a08e9f6ba7ae27b7cf401cf97347f26f377 100644 (file)
@@ -207,7 +207,7 @@ def find_project(mail, list_id=None):
 
     if not project:
         logger.debug(
-            "Could not find a valid project for given list-id and " "subject."
+            'Could not find a valid project for given list-id and ' 'subject.'
         )
 
     return project
@@ -412,7 +412,7 @@ def get_original_sender(mail, name, email):
     cc_headers = mail.get_all('Cc') or []
     for header in reply_to_headers + cc_headers:
         header = clean_header(header)
-        addrs = header.split(",")
+        addrs = header.split(',')
         for addr in addrs:
             new_name, new_email = split_from_header(addr)
             if new_name:
@@ -520,8 +520,8 @@ def find_message_id(mail):
         # about this
         logger.info(
             "Malformed 'Message-Id' header. The 'msg-id' component should be "
-            "surrounded by angle brackets. Saving raw header. This may "
-            "include comments and extra whitespace."
+            'surrounded by angle brackets. Saving raw header. This may '
+            'include comments and extra whitespace.'
         )
         msgid = header.strip()
 
@@ -547,8 +547,8 @@ def find_references(mail):
         else:
             logger.info(
                 "Malformed 'In-Reply-To' header. The 'msg-id' component "
-                "should be surrounded by angle brackets. Saving raw header. "
-                "This may include comments and extra whitespace."
+                'should be surrounded by angle brackets. Saving raw header. '
+                'This may include comments and extra whitespace.'
             )
             ref = header.strip()
         refs.append(ref)
index cf22f251162478573f372ee21805efc82299b5c2..d3f023f720eaf0f444b1fc50f961b4eea497a91f 100644 (file)
@@ -23,7 +23,7 @@ def patch_tags(patch):
         count = getattr(patch, tag.attr_name)
         titles.append('%d %s' % (count, tag.name))
         if count == 0:
-            counts.append("-")
+            counts.append('-')
         else:
             counts.append(str(count))
 
index 0f93774b9b5a019d4eaec29b997c93396c606977..f36bdd2d9f5e93bfea7d891ab4c3fd6a155f8ddc 100644 (file)
@@ -202,18 +202,18 @@ class TestEventAPI(APITestCase):
         self._create_events()
 
         resp = self.client.get(self.api_url())
-        events = Event.objects.order_by("-date").all()
+        events = Event.objects.order_by('-date').all()
         for api_event, event in zip(resp.data, events):
-            self.assertEqual(api_event["id"], event.id)
+            self.assertEqual(api_event['id'], event.id)
 
     def test_order_by_date_ascending(self):
         """Assert the default ordering is by date descending."""
         self._create_events()
 
         resp = self.client.get(self.api_url(), {'order': 'date'})
-        events = Event.objects.order_by("date").all()
+        events = Event.objects.order_by('date').all()
         for api_event, event in zip(resp.data, events):
-            self.assertEqual(api_event["id"], event.id)
+            self.assertEqual(api_event['id'], event.id)
 
     def test_create(self):
         """Ensure creates aren't allowed"""
index f4c9f676aef50ba1bfb3602b2b8285bb0e159d0d..13f53808b9ae1eba1fd4c6d7aed7adae56b559ac 100644 (file)
@@ -81,7 +81,7 @@ class TestPatchAPI(utils.APITestCase):
             state=state_obj,
             project=project_obj,
             submitter=person_obj,
-            **kwargs
+            **kwargs,
         )
 
         return patch_obj
@@ -366,7 +366,7 @@ class TestPatchAPI(utils.APITestCase):
 
         self.client.force_authenticate(user=user)
         resp = self.client.patch(
-            self.api_url(patch.id, version="1.1"),
+            self.api_url(patch.id, version='1.1'),
             {'state': state.slug, 'delegate': user.id},
         )
         self.assertEqual(status.HTTP_200_OK, resp.status_code, resp)
index c39bbbafd27cf0f30ced6b5d28ddb31bc52dbc44..e69159e118d3ec29f2caec622737bacb2354f82d 100644 (file)
@@ -138,7 +138,7 @@ class APIClient(BaseAPIClient):
         format=None,
         content_type=None,
         follow=False,
-        **extra
+        **extra,
     ):
         validate_request = extra.pop('validate_request', True)
         validate_response = extra.pop('validate_response', True)
@@ -149,7 +149,7 @@ class APIClient(BaseAPIClient):
             format='json',
             content_type=content_type,
             SERVER_NAME='example.com',
-            **extra
+            **extra,
         )
         response = super(APIClient, self).post(
             path,
@@ -158,7 +158,7 @@ class APIClient(BaseAPIClient):
             content_type=content_type,
             follow=follow,
             SERVER_NAME='example.com',
-            **extra
+            **extra,
         )
 
         validator.validate_data(
@@ -174,7 +174,7 @@ class APIClient(BaseAPIClient):
         format=None,
         content_type=None,
         follow=False,
-        **extra
+        **extra,
     ):
         validate_request = extra.pop('validate_request', True)
         validate_response = extra.pop('validate_response', True)
@@ -185,7 +185,7 @@ class APIClient(BaseAPIClient):
             format='json',
             content_type=content_type,
             SERVER_NAME='example.com',
-            **extra
+            **extra,
         )
         response = super(APIClient, self).put(
             path,
@@ -194,7 +194,7 @@ class APIClient(BaseAPIClient):
             content_type=content_type,
             follow=follow,
             SERVER_NAME='example.com',
-            **extra
+            **extra,
         )
 
         validator.validate_data(
@@ -210,7 +210,7 @@ class APIClient(BaseAPIClient):
         format=None,
         content_type=None,
         follow=False,
-        **extra
+        **extra,
     ):
         validate_request = extra.pop('validate_request', True)
         validate_response = extra.pop('validate_response', True)
@@ -221,7 +221,7 @@ class APIClient(BaseAPIClient):
             format='json',
             content_type=content_type,
             SERVER_NAME='example.com',
-            **extra
+            **extra,
         )
         response = super(APIClient, self).patch(
             path,
@@ -230,7 +230,7 @@ class APIClient(BaseAPIClient):
             content_type=content_type,
             follow=follow,
             SERVER_NAME='example.com',
-            **extra
+            **extra,
         )
 
         validator.validate_data(
index 84f3abad58d2d2081f8f645ff0cc35ed80a76471..291ddbc13edf74dbdff09c64931ec74f5ab2f3f3 100644 (file)
@@ -69,7 +69,7 @@ class ColourTextTestResult(TestResult):
         if unexpectedSuccesses:
             self.stream.writeln('=' * 70)
             for test in unexpectedSuccesses:
-                self.stream.writeln(f"UNEXPECTED SUCCESS: {str(test)}")
+                self.stream.writeln(f'UNEXPECTED SUCCESS: {str(test)}')
             self.stream.flush()
 
     def printErrorList(self, flavour, errors):
index 1eaecab11ebdd61d54e339ff859e02055a45f4b7..919f9f464e5afa738b7b387141330b5fa9619ff0 100644 (file)
@@ -767,15 +767,15 @@ class PatchParseTest(PatchTest):
     def test_git_rename(self):
         diff, _ = self._find_content('0008-git-rename.mbox')
         self.assertTrue(diff is not None)
-        self.assertEqual(diff.count("\nrename from "), 2)
-        self.assertEqual(diff.count("\nrename to "), 2)
+        self.assertEqual(diff.count('\nrename from '), 2)
+        self.assertEqual(diff.count('\nrename to '), 2)
 
     def test_git_rename_with_diff(self):
         diff, message = self._find_content('0009-git-rename-with-diff.mbox')
         self.assertTrue(diff is not None)
         self.assertTrue(message is not None)
-        self.assertEqual(diff.count("\nrename from "), 2)
-        self.assertEqual(diff.count("\nrename to "), 2)
+        self.assertEqual(diff.count('\nrename from '), 2)
+        self.assertEqual(diff.count('\nrename to '), 2)
         self.assertEqual(diff.count('\n-a\n+b'), 1)
 
     def test_git_new_empty_file(self):
@@ -886,7 +886,7 @@ class CommentParseTest(TestCase):
 class DelegateRequestTest(TestCase):
     patch_filename = '0001-add-line.patch'
     msgid = '<1@example.com>'
-    invalid_delegate_email = "nobody"
+    invalid_delegate_email = 'nobody'
 
     def setUp(self):
         self.patch = read_patch(self.patch_filename)
@@ -988,7 +988,7 @@ class CommentActionRequiredTest(TestCase):
 class InitialPatchStateTest(TestCase):
     patch_filename = '0001-add-line.patch'
     msgid = '<1@example.com>'
-    invalid_state_name = "Nonexistent Test State"
+    invalid_state_name = 'Nonexistent Test State'
 
     def setUp(self):
         self.default_state = create_state()
@@ -1110,10 +1110,10 @@ class SubjectTest(TestCase):
         self.assertEqual(clean_subject('Re: meep'), ('meep', []))
         self.assertEqual(clean_subject('[PATCH] meep'), ('meep', []))
         self.assertEqual(
-            clean_subject("[PATCH] meep \n meep"), ('meep meep', [])
+            clean_subject('[PATCH] meep \n meep'), ('meep meep', [])
         )
         self.assertEqual(
-            clean_subject("[PATCH] meep,\n meep"), ('meep, meep', [])
+            clean_subject('[PATCH] meep,\n meep'), ('meep, meep', [])
         )
         self.assertEqual(
             clean_subject('[PATCH RFC] meep'), ('[RFC] meep', ['RFC'])
index 1f19097a2396bdf14c8d4558ed5976fbb5366819..3c3b0c5d0c401ee0e20e05155845c996fdfd75e3 100644 (file)
@@ -503,7 +503,7 @@ class PasswordChangeTest(_UserTestCase):
 
         response = self.client.get(reverse('password_change_done'))
         self.assertContains(
-            response, "Your password has been changed successfully"
+            response, 'Your password has been changed successfully'
         )
 
 
index 2b44cfdaf8599c30f1befdc22f1bf4e121395e68..61fa0763342c8e5d015a8022bb1ddadd70ee849f 100644 (file)
@@ -214,7 +214,7 @@ class MboxPatchResponseTest(TestCase):
         date = tz_utils.now() - datetime.timedelta(days=1)
         date = date.replace(tzinfo=tz, microsecond=0)
 
-        patch.headers = 'Date: %s\n' % date.strftime("%a, %d %b %Y %T %z")
+        patch.headers = 'Date: %s\n' % date.strftime('%a, %d %b %Y %T %z')
         patch.save()
 
         mbox = utils.patch_to_mbox(patch)
index c33e7ade0628910c53d30f33200bd984d6599d1b..71579eefb01b1193d4dc80cc3d32d897e24c63d1 100644 (file)
@@ -119,13 +119,13 @@ class XMLRPCModelTestMixin(object):
 
     def test_list_max_count(self):
         objs = self.create_multiple(5)
-        result = self.list_endpoint("", 2)
+        result = self.list_endpoint('', 2)
         self.assertEqual(len(result), 2)
         self.assertEqual(result[0]['id'], objs[0].id)
 
     def test_list_negative_max_count(self):
         objs = self.create_multiple(5)
-        result = self.list_endpoint("", -1)
+        result = self.list_endpoint('', -1)
         self.assertEqual(len(result), 1)
         self.assertEqual(result[0]['id'], objs[-1].id)
 
index cdad279d4090ad730582b4bb350ce5a84a1c2c1b..704ab815393a866e327c962e3727b68b8fa50304 100644 (file)
@@ -116,7 +116,7 @@ def set_bundle(request, project, action, data, patches, context):
     if action == 'create':
         bundle_name = data['bundle_name'].strip()
         if '/' in bundle_name:
-            return ['Bundle names can\'t contain slashes']
+            return ["Bundle names can't contain slashes"]
 
         if not bundle_name:
             return ['No bundle name was specified']
@@ -126,7 +126,7 @@ def set_bundle(request, project, action, data, patches, context):
 
         bundle = Bundle(owner=user, project=project, name=bundle_name)
         bundle.save()
-        messages.success(request, "Bundle %s created" % bundle.name)
+        messages.success(request, 'Bundle %s created' % bundle.name)
     elif action == 'add':
         bundle = get_object_or_404(Bundle, id=data['bundle_id'])
     elif action == 'remove':
index 323a1f7475599dce182b64daaad583fcd7c0d295..6b7c264ad4b9b7daa130335bb6e86f3024c26c79 100644 (file)
@@ -157,9 +157,9 @@ def bundle_mbox(request, username, bundlename):
         return HttpResponseNotFound()
 
     response = HttpResponse(content_type='text/plain')
-    response[
-        'Content-Disposition'
-    ] = 'attachment; filename=bundle-%d-%s.mbox' % (bundle.id, bundle.name)
+    response['Content-Disposition'] = (
+        'attachment; filename=bundle-%d-%s.mbox' % (bundle.id, bundle.name)
+    )
     response.write(bundle_to_mbox(bundle))
 
     return response
index 8bc3af2445fd45cbf6aac651267a44dcff2108a7..7c864c9cecb193c4a4094b12715ed4a539b3f186 100644 (file)
@@ -90,7 +90,7 @@ def _optinout(request, action):
         and EmailOptout.objects.filter(email=email).count() == 0
     ):
         context['error'] = (
-            "The email address %s is not on the patchwork "
+            'The email address %s is not on the patchwork '
             "opt-out list, so you don't need to opt back in" % email
         )
         context['form'] = form
index e2c595fbaa7b65f131bfafab3c59aeb342efcc62..54cf992c524adacfa1daba0a7d1bec93c3206abe 100644 (file)
@@ -156,7 +156,7 @@ def patch_raw(request, project_id, msgid):
     project = get_object_or_404(Project, linkname=project_id)
     patch = get_object_or_404(Patch, project_id=project.id, msgid=db_msgid)
 
-    response = HttpResponse(content_type="text/x-patch")
+    response = HttpResponse(content_type='text/x-patch')
     response.write(patch.diff)
     response['Content-Disposition'] = 'attachment; filename=%s.diff' % (
         patch.filename
index cc8595d6327c2d2b86e4cee9e8877d9f6d04550e..572854cf343e95a877690dd59fa9ab094fc043cd 100644 (file)
@@ -53,12 +53,12 @@ def _submission_to_mbox(submission):
     body = ''
 
     if submission.content:
-        body = submission.content.strip() + "\n"
+        body = submission.content.strip() + '\n'
 
     parts = postscript_re.split(body, 1)
     if len(parts) == 2:
         (body, postscript) = parts
-        body = body.strip() + "\n"
+        body = body.strip() + '\n'
         postscript = postscript.rstrip()
     else:
         postscript = ''
index e17d83ea242a4f4ba68a12a57c60dce57ee42c12..a936798e116ce930c6b632ea9cd7be210d00e99b 100644 (file)
@@ -911,7 +911,7 @@ def check_get(check_id):
 
 @xmlrpc_method(login_required=True)
 def check_create(
-    user, patch_id, context, state, target_url="", description=""
+    user, patch_id, context, state, target_url='', description=''
 ):
     """Add a Check to a patch.
 
@@ -935,7 +935,7 @@ def check_create(
             state = state_val
             break
     else:
-        raise Exception("Invalid check state: %s" % state)
+        raise Exception('Invalid check state: %s' % state)
     Check.objects.create(
         patch=patch,
         context=context,