get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/1523329/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1523329,
    "url": "http://patchwork.ozlabs.org/api/patches/1523329/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/patchwork/patch/20210901165756.181192-9-stephen@that.guru/",
    "project": {
        "id": 16,
        "url": "http://patchwork.ozlabs.org/api/projects/16/?format=api",
        "name": "Patchwork",
        "link_name": "patchwork",
        "list_id": "patchwork.lists.ozlabs.org",
        "list_email": "patchwork@lists.ozlabs.org",
        "web_url": "http://jk.ozlabs.org/projects/patchwork/",
        "scm_url": "git://github.com/getpatchwork/patchwork",
        "webscm_url": "https://github.com/getpatchwork/patchwork",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20210901165756.181192-9-stephen@that.guru>",
    "list_archive_url": null,
    "date": "2021-09-01T16:57:45",
    "name": "[RFC,v2,08/19] trivial: Run views through black",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": false,
    "hash": "76ac6d95981bbc3977de36c662841e99fc2c8afd",
    "submitter": {
        "id": 69991,
        "url": "http://patchwork.ozlabs.org/api/people/69991/?format=api",
        "name": "Stephen Finucane",
        "email": "stephen@that.guru"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/patchwork/patch/20210901165756.181192-9-stephen@that.guru/mbox/",
    "series": [
        {
            "id": 260605,
            "url": "http://patchwork.ozlabs.org/api/series/260605/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/patchwork/list/?series=260605",
            "date": "2021-09-01T16:57:37",
            "name": "Integrate Bulma",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/260605/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1523329/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1523329/checks/",
    "tags": {},
    "related": [
        {
            "id": 1516040,
            "url": "http://patchwork.ozlabs.org/api/patches/1516040/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/patchwork/patch/20210811213705.36293-9-stephen@that.guru/",
            "msgid": "<20210811213705.36293-9-stephen@that.guru>",
            "list_archive_url": null,
            "date": "2021-08-11T21:36:54",
            "name": "[RFC,08/19] trivial: Run views through black",
            "mbox": "http://patchwork.ozlabs.org/project/patchwork/patch/20210811213705.36293-9-stephen@that.guru/mbox/"
        }
    ],
    "headers": {
        "Return-Path": "\n <patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "patchwork@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "patchwork@lists.ozlabs.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" header.d=that.guru\n header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=daSB9y2I;\n\tdkim-atps=neutral",
            "ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=112.213.38.117; helo=lists.ozlabs.org;\n envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)",
            "lists.ozlabs.org;\n\tdkim=fail reason=\"key not found in DNS\" header.d=that.guru\n header.i=@that.guru header.a=rsa-sha256 header.s=x header.b=daSB9y2I;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=that.guru\n (client-ip=136.175.108.227; helo=mail-108-mta227.mxroute.com;\n envelope-from=stephen@that.guru; receiver=<UNKNOWN>)",
            "lists.ozlabs.org;\n dkim=fail reason=\"key not found in DNS\" header.d=that.guru\n header.i=@that.guru\n header.a=rsa-sha256 header.s=x header.b=daSB9y2I;\n dkim-atps=neutral"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 4H09JB27nRz9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  2 Sep 2021 02:59:06 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4H09JB0dlQz2ypR\n\tfor <incoming@patchwork.ozlabs.org>; Thu,  2 Sep 2021 02:59:06 +1000 (AEST)",
            "from mail-108-mta227.mxroute.com (mail-108-mta227.mxroute.com\n [136.175.108.227])\n (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n (No client certificate requested)\n by lists.ozlabs.org (Postfix) with ESMTPS id 4H09Hm5RD4z2yb9\n for <patchwork@lists.ozlabs.org>; Thu,  2 Sep 2021 02:58:44 +1000 (AEST)",
            "from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)\n (Authenticated sender: mN4UYu2MZsgR)\n by mail-108-mta227.mxroute.com (ZoneMTA) with ESMTPSA id\n 17ba24c561b00074ba.001 for <patchwork@lists.ozlabs.org>\n (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);\n Wed, 01 Sep 2021 16:58:36 +0000"
        ],
        "X-Zone-Loop": "bb1b313b9c65b6cbafb35adbc44549b8034542b22ee1",
        "X-Originating-IP": "[149.28.56.236]",
        "DKIM-Signature": "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=that.guru;\n s=x;\n h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:\n Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:\n Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n List-Post:List-Owner:List-Archive;\n bh=PS1vNVOgfoz/Lunj5YysJk3wDRdLDag5XVJ1jXkgY0s=; b=daSB9y2IPrp0xn9HdWSyGGYFW9\n d8bi8l+PP23PT9uXvD1HJD/OE5R9VUbPbfIY9E5CepWaBi+IdFOzF5xijKATKubNuE8zGvZ4/R8pi\n dblV3EiwzCgbrtAoaZ5Qmdx5/frcaLdlYgLuzJw+3yeuTa6HGRdMOYKyTf/y+zJd0jQpAc4W+BXfA\n UttLuUixgzv2uVg3SqcpLOraQ746pDB3AzhkS2jXF8i+CoYBDfRuwbT0edERej6WVxAA7FgrZR/9T\n 6vdfQYxjAAmktrG7ZNZIXHdg00EavgExLOmqNGK8G5p9muURCZUV2wN/ZYWawkKuTLMob4bCikaQz\n clZEqrbA==;",
        "From": "Stephen Finucane <stephen@that.guru>",
        "To": "patchwork@lists.ozlabs.org",
        "Subject": "[RFC PATCH v2 08/19] trivial: Run views through black",
        "Date": "Wed,  1 Sep 2021 17:57:45 +0100",
        "Message-Id": "<20210901165756.181192-9-stephen@that.guru>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210901165756.181192-1-stephen@that.guru>",
        "References": "<20210901165756.181192-1-stephen@that.guru>",
        "MIME-Version": "1.0",
        "X-AuthUser": "stephen@that.guru",
        "X-BeenThere": "patchwork@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "Patchwork development <patchwork.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/patchwork>,\n <mailto:patchwork-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/patchwork/>",
        "List-Post": "<mailto:patchwork@lists.ozlabs.org>",
        "List-Help": "<mailto:patchwork-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/patchwork>,\n <mailto:patchwork-request@lists.ozlabs.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Patchwork\"\n <patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "Do this before conducting major surgery on these views.\n\nSigned-off-by: Stephen Finucane <stephen@that.guru>\n---\n patchwork/views/__init__.py | 107 ++++++++++++++++++++++++------------\n patchwork/views/api.py      |  13 +++--\n patchwork/views/bundle.py   |  71 +++++++++++++++---------\n patchwork/views/cover.py    |  42 ++++++++------\n patchwork/views/mail.py     |  24 +++++---\n patchwork/views/patch.py    |  90 +++++++++++++++++++-----------\n patchwork/views/project.py  |   7 ++-\n patchwork/views/pwclient.py |   5 +-\n patchwork/views/series.py   |   3 +-\n patchwork/views/user.py     |  96 +++++++++++++++++++-------------\n patchwork/views/utils.py    |  27 +++++----\n patchwork/views/xmlrpc.py   |  63 ++++++++++++++-------\n 12 files changed, 350 insertions(+), 198 deletions(-)",
    "diff": "diff --git patchwork/views/__init__.py patchwork/views/__init__.py\nindex 3efe90cd..c3199ffd 100644\n--- patchwork/views/__init__.py\n+++ patchwork/views/__init__.py\n@@ -124,8 +124,7 @@ def set_bundle(request, project, action, data, patches, context):\n         if Bundle.objects.filter(owner=user, name=bundle_name).count() > 0:\n             return ['You already have a bundle called \"%s\"' % bundle_name]\n \n-        bundle = Bundle(owner=user, project=project,\n-                        name=bundle_name)\n+        bundle = Bundle(owner=user, project=project, name=bundle_name)\n         bundle.save()\n         messages.success(request, \"Bundle %s created\" % bundle.name)\n     elif action == 'add':\n@@ -138,15 +137,22 @@ def set_bundle(request, project, action, data, patches, context):\n \n     for patch in patches:\n         if action in ['create', 'add']:\n-            bundlepatch_count = BundlePatch.objects.filter(bundle=bundle,\n-                                                           patch=patch).count()\n+            bundlepatch_count = BundlePatch.objects.filter(\n+                bundle=bundle, patch=patch\n+            ).count()\n             if bundlepatch_count == 0:\n                 bundle.append_patch(patch)\n-                messages.success(request, \"Patch '%s' added to bundle %s\" %\n-                                 (patch.name, bundle.name))\n+                messages.success(\n+                    request,\n+                    \"Patch '%s' added to bundle %s\"\n+                    % (patch.name, bundle.name),\n+                )\n             else:\n-                messages.warning(request, \"Patch '%s' already in bundle %s\" %\n-                                 (patch.name, bundle.name))\n+                messages.warning(\n+                    request,\n+                    \"Patch '%s' already in bundle %s\"\n+                    % (patch.name, bundle.name),\n+                )\n         elif action == 'remove':\n             try:\n                 bp = BundlePatch.objects.get(bundle=bundle, patch=patch)\n@@ -156,16 +162,24 @@ def set_bundle(request, project, action, data, patches, context):\n             else:\n                 messages.success(\n                     request,\n-                    \"Patch '%s' removed from bundle %s\\n\" % (patch.name,\n-                                                             bundle.name))\n+                    \"Patch '%s' removed from bundle %s\\n\"\n+                    % (patch.name, bundle.name),\n+                )\n \n     bundle.save()\n \n     return []\n \n \n-def generic_list(request, project, view, view_args=None, filter_settings=None,\n-                 patches=None, editable_order=False):\n+def generic_list(\n+    request,\n+    project,\n+    view,\n+    view_args=None,\n+    filter_settings=None,\n+    patches=None,\n+    editable_order=False,\n+):\n \n     if not filter_settings:\n         filter_settings = []\n@@ -198,13 +212,16 @@ def generic_list(request, project, view, view_args=None, filter_settings=None,\n         data = request.POST\n     order = Order(data.get('order'), editable=editable_order)\n \n-    context.update({\n-        'order': order,\n-        'list_view': {\n-            'view': view,\n-            'view_params': view_args or {},\n-            'params': params\n-        }})\n+    context.update(\n+        {\n+            'order': order,\n+            'list_view': {\n+                'view': view,\n+                'view_params': view_args or {},\n+                'params': params,\n+            },\n+        }\n+    )\n \n     # form processing\n \n@@ -240,8 +257,9 @@ def generic_list(request, project, view, view_args=None, filter_settings=None,\n             errors = set_bundle(request, project, action, data, ps, context)\n \n         elif properties_form and action == properties_form.action:\n-            errors = process_multiplepatch_form(request, properties_form,\n-                                                action, ps, context)\n+            errors = process_multiplepatch_form(\n+                request, properties_form, action, ps, context\n+            )\n         else:\n             errors = []\n \n@@ -272,25 +290,41 @@ def generic_list(request, project, view, view_args=None, filter_settings=None,\n \n     # but we will need to follow the state and submitter relations for\n     # rendering the list template\n-    patches = patches.select_related('state', 'submitter', 'delegate',\n-                                     'series')\n-\n-    patches = patches.only('state', 'submitter', 'delegate', 'project',\n-                           'series__name', 'name', 'date', 'msgid')\n+    patches = patches.select_related(\n+        'state', 'submitter', 'delegate', 'series'\n+    )\n+\n+    patches = patches.only(\n+        'state',\n+        'submitter',\n+        'delegate',\n+        'project',\n+        'series__name',\n+        'name',\n+        'date',\n+        'msgid',\n+    )\n \n     # we also need checks and series\n     patches = patches.prefetch_related(\n-        Prefetch('check_set', queryset=Check.objects.only(\n-            'context', 'user_id', 'patch_id', 'state', 'date')))\n+        Prefetch(\n+            'check_set',\n+            queryset=Check.objects.only(\n+                'context', 'user_id', 'patch_id', 'state', 'date'\n+            ),\n+        )\n+    )\n \n     paginator = Paginator(request, patches)\n \n-    context.update({\n-        'page': paginator.current_page,\n-        'patchform': properties_form,\n-        'project': project,\n-        'order': order,\n-    })\n+    context.update(\n+        {\n+            'page': paginator.current_page,\n+            'patchform': properties_form,\n+            'project': project,\n+            'order': order,\n+        }\n+    )\n \n     return context\n \n@@ -308,8 +342,9 @@ def process_multiplepatch_form(request, form, action, patches, context):\n     changed_patches = 0\n     for patch in patches:\n         if not patch.is_editable(request.user):\n-            errors.append(\"You don't have permissions to edit patch '%s'\"\n-                          % patch.name)\n+            errors.append(\n+                \"You don't have permissions to edit patch '%s'\" % patch.name\n+            )\n             continue\n \n         changed_patches += 1\ndiff --git patchwork/views/api.py patchwork/views/api.py\nindex 55ffad9c..283e6712 100644\n--- patchwork/views/api.py\n+++ patchwork/views/api.py\n@@ -41,8 +41,9 @@ def _handle_request(request, queryset_fn, formatter):\n \n def submitters(request):\n     def queryset(search):\n-        return Person.objects.filter(Q(name__icontains=search) |\n-                                     Q(email__icontains=search))\n+        return Person.objects.filter(\n+            Q(name__icontains=search) | Q(email__icontains=search)\n+        )\n \n     def formatter(submitter):\n         return {\n@@ -56,9 +57,11 @@ def submitters(request):\n \n def delegates(request):\n     def queryset(search):\n-        return User.objects.filter(Q(username__icontains=search) |\n-                                   Q(first_name__icontains=search) |\n-                                   Q(last_name__icontains=search))\n+        return User.objects.filter(\n+            Q(username__icontains=search)\n+            | Q(first_name__icontains=search)\n+            | Q(last_name__icontains=search)\n+        )\n \n     def formatter(user):\n         return {\ndiff --git patchwork/views/bundle.py patchwork/views/bundle.py\nindex 3e227f4c..323a1f74 100644\n--- patchwork/views/bundle.py\n+++ patchwork/views/bundle.py\n@@ -52,8 +52,9 @@ def bundle_list(request, project_id=None):\n         if form_name == DeleteBundleForm.name:\n             form = DeleteBundleForm(request.POST)\n             if form.is_valid():\n-                bundle = get_object_or_404(Bundle,\n-                                           id=form.cleaned_data['bundle_id'])\n+                bundle = get_object_or_404(\n+                    Bundle, id=form.cleaned_data['bundle_id']\n+                )\n                 bundle.delete()\n \n     if project_id is None:\n@@ -63,8 +64,9 @@ def bundle_list(request, project_id=None):\n         bundles = request.user.bundles.filter(project=project)\n \n     for bundle in bundles:\n-        bundle.delete_form = DeleteBundleForm(auto_id=False,\n-                                              initial={'bundle_id': bundle.id})\n+        bundle.delete_form = DeleteBundleForm(\n+            auto_id=False, initial={'bundle_id': bundle.id}\n+        )\n \n     context = {\n         'bundles': bundles,\n@@ -75,8 +77,9 @@ def bundle_list(request, project_id=None):\n \n \n def bundle_detail(request, username, bundlename):\n-    bundle = get_object_or_404(Bundle, owner__username=username,\n-                               name=bundlename)\n+    bundle = get_object_or_404(\n+        Bundle, owner__username=username, name=bundlename\n+    )\n     filter_settings = [(DelegateFilter, DelegateFilter.ANY_DELEGATE)]\n \n     is_owner = request.user == bundle.owner\n@@ -105,30 +108,38 @@ def bundle_detail(request, username, bundlename):\n         else:\n             form = BundleForm(instance=bundle)\n \n-        if (request.method == 'POST' and\n-            request.POST.get('form') == 'reorderform'):\n+        if (\n+            request.method == 'POST'\n+            and request.POST.get('form') == 'reorderform'\n+        ):\n             order = get_object_or_404(\n                 BundlePatch,\n                 bundle=bundle,\n-                patch__id=request.POST.get('order_start')).order\n+                patch__id=request.POST.get('order_start'),\n+            ).order\n \n             for patch_id in request.POST.getlist('neworder'):\n-                bundlepatch = get_object_or_404(BundlePatch,\n-                                                bundle=bundle,\n-                                                patch__id=patch_id)\n+                bundlepatch = get_object_or_404(\n+                    BundlePatch, bundle=bundle, patch__id=patch_id\n+                )\n                 bundlepatch.order = order\n                 bundlepatch.save()\n                 order += 1\n     else:\n         form = None\n \n-    context = generic_list(request, bundle.project,\n-                           'bundle-detail',\n-                           view_args={'username': bundle.owner.username,\n-                                      'bundlename': bundle.name},\n-                           filter_settings=filter_settings,\n-                           patches=bundle.ordered_patches(),\n-                           editable_order=is_owner)\n+    context = generic_list(\n+        request,\n+        bundle.project,\n+        'bundle-detail',\n+        view_args={\n+            'username': bundle.owner.username,\n+            'bundlename': bundle.name,\n+        },\n+        filter_settings=filter_settings,\n+        patches=bundle.ordered_patches(),\n+        editable_order=is_owner,\n+    )\n \n     context['bundle'] = bundle\n     context['bundleform'] = form\n@@ -137,16 +148,18 @@ def bundle_detail(request, username, bundlename):\n \n \n def bundle_mbox(request, username, bundlename):\n-    bundle = get_object_or_404(Bundle, owner__username=username,\n-                               name=bundlename)\n+    bundle = get_object_or_404(\n+        Bundle, owner__username=username, name=bundlename\n+    )\n \n     request.user = rest_auth(request)\n     if not (request.user == bundle.owner or bundle.public):\n         return HttpResponseNotFound()\n \n     response = HttpResponse(content_type='text/plain')\n-    response['Content-Disposition'] = \\\n-        'attachment; filename=bundle-%d-%s.mbox' % (bundle.id, bundle.name)\n+    response[\n+        'Content-Disposition'\n+    ] = 'attachment; filename=bundle-%d-%s.mbox' % (bundle.id, bundle.name)\n     response.write(bundle_to_mbox(bundle))\n \n     return response\n@@ -162,7 +175,11 @@ def bundle_detail_redir(request, bundle_id):\n def bundle_mbox_redir(request, bundle_id):\n     bundle = get_object_or_404(Bundle, id=bundle_id, owner=request.user)\n     return HttpResponseRedirect(\n-        reverse('bundle-mbox', kwargs={\n-            'username': request.user.username,\n-            'bundlename': bundle.name,\n-        }))\n+        reverse(\n+            'bundle-mbox',\n+            kwargs={\n+                'username': request.user.username,\n+                'bundlename': bundle.name,\n+            },\n+        )\n+    )\ndiff --git patchwork/views/cover.py patchwork/views/cover.py\nindex 8ab0ba99..3368186b 100644\n--- patchwork/views/cover.py\n+++ patchwork/views/cover.py\n@@ -18,12 +18,11 @@ from patchwork.views.utils import cover_to_mbox\n \n def cover_detail(request, project_id, msgid):\n     project = get_object_or_404(Project, linkname=project_id)\n-    db_msgid = ('<%s>' % msgid)\n+    db_msgid = '<%s>' % msgid\n \n     # redirect to patches where necessary\n     try:\n-        cover = get_object_or_404(Cover, project_id=project.id,\n-                                  msgid=db_msgid)\n+        cover = get_object_or_404(Cover, project_id=project.id, msgid=db_msgid)\n     except Http404 as exc:\n         patches = Patch.objects.filter(\n             project_id=project.id,\n@@ -31,9 +30,11 @@ def cover_detail(request, project_id, msgid):\n         )\n         if patches:\n             return HttpResponseRedirect(\n-                reverse('patch-detail',\n-                        kwargs={'project_id': project.linkname,\n-                                'msgid': msgid}))\n+                reverse(\n+                    'patch-detail',\n+                    kwargs={'project_id': project.linkname, 'msgid': msgid},\n+                )\n+            )\n         raise exc\n \n     context = {\n@@ -43,23 +44,22 @@ def cover_detail(request, project_id, msgid):\n \n     comments = cover.comments.all()\n     comments = comments.select_related('submitter')\n-    comments = comments.only('submitter', 'date', 'id', 'content',\n-                             'cover')\n+    comments = comments.only('submitter', 'date', 'id', 'content', 'cover')\n     context['comments'] = comments\n \n     return render(request, 'patchwork/submission.html', context)\n \n \n def cover_mbox(request, project_id, msgid):\n-    db_msgid = ('<%s>' % msgid)\n+    db_msgid = '<%s>' % msgid\n     project = get_object_or_404(Project, linkname=project_id)\n-    cover = get_object_or_404(Cover, project_id=project.id,\n-                              msgid=db_msgid)\n+    cover = get_object_or_404(Cover, project_id=project.id, msgid=db_msgid)\n \n     response = HttpResponse(content_type='text/plain')\n     response.write(cover_to_mbox(cover))\n     response['Content-Disposition'] = 'attachment; filename=%s.mbox' % (\n-        cover.filename)\n+        cover.filename\n+    )\n \n     return response\n \n@@ -67,8 +67,13 @@ def cover_mbox(request, project_id, msgid):\n def cover_by_id(request, cover_id):\n     cover = get_object_or_404(Cover, id=cover_id)\n \n-    url = reverse('cover-detail', kwargs={'project_id': cover.project.linkname,\n-                                          'msgid': cover.url_msgid})\n+    url = reverse(\n+        'cover-detail',\n+        kwargs={\n+            'project_id': cover.project.linkname,\n+            'msgid': cover.url_msgid,\n+        },\n+    )\n \n     return HttpResponseRedirect(url)\n \n@@ -76,7 +81,12 @@ def cover_by_id(request, cover_id):\n def cover_mbox_by_id(request, cover_id):\n     cover = get_object_or_404(Cover, id=cover_id)\n \n-    url = reverse('cover-mbox', kwargs={'project_id': cover.project.linkname,\n-                                        'msgid': cover.url_msgid})\n+    url = reverse(\n+        'cover-mbox',\n+        kwargs={\n+            'project_id': cover.project.linkname,\n+            'msgid': cover.url_msgid,\n+        },\n+    )\n \n     return HttpResponseRedirect(url)\ndiff --git patchwork/views/mail.py patchwork/views/mail.py\nindex 4bc7be0f..8b31fc9e 100644\n--- patchwork/views/mail.py\n+++ patchwork/views/mail.py\n@@ -78,17 +78,21 @@ def _optinout(request, action):\n \n     form = EmailForm(data=request.POST)\n     if not form.is_valid():\n-        context['error'] = ('There was an error in the form. Please review '\n-                            'and re-submit.')\n+        context['error'] = (\n+            'There was an error in the form. Please review ' 'and re-submit.'\n+        )\n         context['form'] = form\n         return render(request, html_template, context)\n \n     email = form.cleaned_data['email']\n-    if action == 'optin' and EmailOptout.objects.filter(\n-            email=email).count() == 0:\n-        context['error'] = (\"The email address %s is not on the patchwork \"\n-                            \"opt-out list, so you don't need to opt back in\" %\n-                            email)\n+    if (\n+        action == 'optin'\n+        and EmailOptout.objects.filter(email=email).count() == 0\n+    ):\n+        context['error'] = (\n+            \"The email address %s is not on the patchwork \"\n+            \"opt-out list, so you don't need to opt back in\" % email\n+        )\n         context['form'] = form\n         return render(request, html_template, context)\n \n@@ -104,8 +108,10 @@ def _optinout(request, action):\n         send_mail(subject, message, conf_settings.DEFAULT_FROM_EMAIL, [email])\n     except smtplib.SMTPException:\n         context['confirmation'] = None\n-        context['error'] = ('An error occurred during confirmation . '\n-                            'Please try again later.')\n+        context['error'] = (\n+            'An error occurred during confirmation . '\n+            'Please try again later.'\n+        )\n         context['admins'] = conf_settings.ADMINS\n \n     return render(request, html_template, context)\ndiff --git patchwork/views/patch.py patchwork/views/patch.py\nindex 00b0147f..0cf2ceb2 100644\n--- patchwork/views/patch.py\n+++ patchwork/views/patch.py\n@@ -25,8 +25,12 @@ from patchwork.views.utils import series_patch_to_mbox\n \n def patch_list(request, project_id):\n     project = get_object_or_404(Project, linkname=project_id)\n-    context = generic_list(request, project, 'patch-list',\n-                           view_args={'project_id': project.linkname})\n+    context = generic_list(\n+        request,\n+        project,\n+        'patch-list',\n+        view_args={'project_id': project.linkname},\n+    )\n \n     if request.user.is_authenticated:\n         context['bundles'] = request.user.bundles.all()\n@@ -36,7 +40,7 @@ def patch_list(request, project_id):\n \n def patch_detail(request, project_id, msgid):\n     project = get_object_or_404(Project, linkname=project_id)\n-    db_msgid = ('<%s>' % msgid)\n+    db_msgid = '<%s>' % msgid\n \n     # redirect to cover letters where necessary\n     try:\n@@ -48,15 +52,15 @@ def patch_detail(request, project_id, msgid):\n         )\n         if covers:\n             return HttpResponseRedirect(\n-                reverse('cover-detail',\n-                        kwargs={'project_id': project.linkname,\n-                                'msgid': msgid}))\n+                reverse(\n+                    'cover-detail',\n+                    kwargs={'project_id': project.linkname, 'msgid': msgid},\n+                )\n+            )\n         raise Http404('Patch does not exist')\n \n     editable = patch.is_editable(request.user)\n-    context = {\n-        'project': patch.project\n-    }\n+    context = {'project': patch.project}\n \n     form = None\n     createbundleform = None\n@@ -73,8 +77,9 @@ def patch_detail(request, project_id, msgid):\n \n         if action == 'createbundle':\n             bundle = Bundle(owner=request.user, project=project)\n-            createbundleform = CreateBundleForm(instance=bundle,\n-                                                data=request.POST)\n+            createbundleform = CreateBundleForm(\n+                instance=bundle, data=request.POST\n+            )\n             if createbundleform.is_valid():\n                 createbundleform.save()\n                 bundle.append_patch(patch)\n@@ -83,16 +88,20 @@ def patch_detail(request, project_id, msgid):\n                 messages.success(request, 'Bundle %s created' % bundle.name)\n         elif action == 'addtobundle':\n             bundle = get_object_or_404(\n-                Bundle, id=request.POST.get('bundle_id'))\n+                Bundle, id=request.POST.get('bundle_id')\n+            )\n             if bundle.append_patch(patch):\n-                messages.success(request,\n-                                 'Patch \"%s\" added to bundle \"%s\"' % (\n-                                     patch.name, bundle.name))\n+                messages.success(\n+                    request,\n+                    'Patch \"%s\" added to bundle \"%s\"'\n+                    % (patch.name, bundle.name),\n+                )\n             else:\n-                messages.error(request,\n-                               'Failed to add patch \"%s\" to bundle \"%s\": '\n-                               'patch is already in bundle' % (\n-                                   patch.name, bundle.name))\n+                messages.error(\n+                    request,\n+                    'Failed to add patch \"%s\" to bundle \"%s\": '\n+                    'patch is already in bundle' % (patch.name, bundle.name),\n+                )\n \n         # all other actions require edit privs\n         elif not editable:\n@@ -114,10 +123,12 @@ def patch_detail(request, project_id, msgid):\n \n     if patch.related:\n         related_same_project = patch.related.patches.only(\n-            'name', 'msgid', 'project', 'related')\n+            'name', 'msgid', 'project', 'related'\n+        )\n         # avoid a second trip out to the db for info we already have\n         related_different_project = [\n-            related_patch for related_patch in related_same_project\n+            related_patch\n+            for related_patch in related_same_project\n             if related_patch.project_id != patch.project_id\n         ]\n     else:\n@@ -140,20 +151,21 @@ def patch_detail(request, project_id, msgid):\n \n \n def patch_raw(request, project_id, msgid):\n-    db_msgid = ('<%s>' % msgid)\n+    db_msgid = '<%s>' % msgid\n     project = get_object_or_404(Project, linkname=project_id)\n     patch = get_object_or_404(Patch, project_id=project.id, msgid=db_msgid)\n \n     response = HttpResponse(content_type=\"text/x-patch\")\n     response.write(patch.diff)\n     response['Content-Disposition'] = 'attachment; filename=%s.diff' % (\n-        patch.filename)\n+        patch.filename\n+    )\n \n     return response\n \n \n def patch_mbox(request, project_id, msgid):\n-    db_msgid = ('<%s>' % msgid)\n+    db_msgid = '<%s>' % msgid\n     project = get_object_or_404(Project, linkname=project_id)\n     patch = get_object_or_404(Patch, project_id=project.id, msgid=db_msgid)\n     series_id = request.GET.get('series')\n@@ -164,7 +176,8 @@ def patch_mbox(request, project_id, msgid):\n     else:\n         response.write(patch_to_mbox(patch))\n     response['Content-Disposition'] = 'attachment; filename=%s.patch' % (\n-        patch.filename)\n+        patch.filename\n+    )\n \n     return response\n \n@@ -172,8 +185,13 @@ def patch_mbox(request, project_id, msgid):\n def patch_by_id(request, patch_id):\n     patch = get_object_or_404(Patch, id=patch_id)\n \n-    url = reverse('patch-detail', kwargs={'project_id': patch.project.linkname,\n-                                          'msgid': patch.url_msgid})\n+    url = reverse(\n+        'patch-detail',\n+        kwargs={\n+            'project_id': patch.project.linkname,\n+            'msgid': patch.url_msgid,\n+        },\n+    )\n \n     return HttpResponseRedirect(url)\n \n@@ -181,8 +199,13 @@ def patch_by_id(request, patch_id):\n def patch_mbox_by_id(request, patch_id):\n     patch = get_object_or_404(Patch, id=patch_id)\n \n-    url = reverse('patch-mbox', kwargs={'project_id': patch.project.linkname,\n-                                        'msgid': patch.url_msgid})\n+    url = reverse(\n+        'patch-mbox',\n+        kwargs={\n+            'project_id': patch.project.linkname,\n+            'msgid': patch.url_msgid,\n+        },\n+    )\n \n     return HttpResponseRedirect(url)\n \n@@ -190,7 +213,12 @@ def patch_mbox_by_id(request, patch_id):\n def patch_raw_by_id(request, patch_id):\n     patch = get_object_or_404(Patch, id=patch_id)\n \n-    url = reverse('patch-raw', kwargs={'project_id': patch.project.linkname,\n-                                       'msgid': patch.url_msgid})\n+    url = reverse(\n+        'patch-raw',\n+        kwargs={\n+            'project_id': patch.project.linkname,\n+            'msgid': patch.url_msgid,\n+        },\n+    )\n \n     return HttpResponseRedirect(url)\ndiff --git patchwork/views/project.py patchwork/views/project.py\nindex 4c25f715..a993618a 100644\n--- patchwork/views/project.py\n+++ patchwork/views/project.py\n@@ -19,8 +19,8 @@ def project_list(request):\n \n     if projects.count() == 1:\n         return HttpResponseRedirect(\n-            reverse('patch-list',\n-                    kwargs={'project_id': projects[0].linkname}))\n+            reverse('patch-list', kwargs={'project_id': projects[0].linkname})\n+        )\n \n     context = {\n         'projects': projects,\n@@ -35,7 +35,8 @@ def project_detail(request, project_id):\n     context = {\n         'project': project,\n         'maintainers': User.objects.filter(\n-            profile__maintainer_projects=project).select_related('profile'),\n+            profile__maintainer_projects=project\n+        ).select_related('profile'),\n         'n_patches': patches.filter(archived=False).count(),\n         'n_archived_patches': patches.filter(archived=True).count(),\n         'enable_xmlrpc': settings.ENABLE_XMLRPC,\ndiff --git patchwork/views/pwclient.py patchwork/views/pwclient.py\nindex 72ebcbbb..a8be425b 100644\n--- patchwork/views/pwclient.py\n+++ patchwork/views/pwclient.py\n@@ -21,8 +21,9 @@ def pwclientrc(request, project_id):\n     else:\n         context['scheme'] = 'http'\n \n-    response = render(request, 'patchwork/pwclientrc', context,\n-                      content_type='text/plain')\n+    response = render(\n+        request, 'patchwork/pwclientrc', context, content_type='text/plain'\n+    )\n     response['Content-Disposition'] = 'attachment; filename=.pwclientrc'\n \n     return response\ndiff --git patchwork/views/series.py patchwork/views/series.py\nindex e0df3adf..a8892ae6 100644\n--- patchwork/views/series.py\n+++ patchwork/views/series.py\n@@ -16,6 +16,7 @@ def series_mbox(request, series_id):\n     response = HttpResponse(content_type='text/plain')\n     response.write(series_to_mbox(series))\n     response['Content-Disposition'] = 'attachment; filename=%s.patch' % (\n-        series.filename)\n+        series.filename\n+    )\n \n     return response\ndiff --git patchwork/views/user.py patchwork/views/user.py\nindex 6b09adb2..7bf6377e 100644\n--- patchwork/views/user.py\n+++ patchwork/views/user.py\n@@ -38,35 +38,41 @@ def register(request):\n             data = form.cleaned_data\n \n             # create inactive user\n-            user = auth.models.User.objects.create_user(data['username'],\n-                                                        data['email'],\n-                                                        data['password'])\n+            user = auth.models.User.objects.create_user(\n+                data['username'], data['email'], data['password']\n+            )\n             user.is_active = False\n             user.first_name = data.get('first_name', '')\n             user.last_name = data.get('last_name', '')\n             user.save()\n \n             # create confirmation\n-            conf = EmailConfirmation(type='registration', user=user,\n-                                     email=user.email)\n+            conf = EmailConfirmation(\n+                type='registration', user=user, email=user.email\n+            )\n             conf.save()\n \n             context['confirmation'] = conf\n \n             # send email\n             subject = render_to_string(\n-                'patchwork/mails/activation-subject.txt')\n+                'patchwork/mails/activation-subject.txt'\n+            )\n             message = render_to_string(\n                 'patchwork/mails/activation.txt',\n-                {'site': Site.objects.get_current(), 'confirmation': conf})\n+                {'site': Site.objects.get_current(), 'confirmation': conf},\n+            )\n \n             try:\n-                send_mail(subject, message, settings.DEFAULT_FROM_EMAIL,\n-                          [conf.email])\n+                send_mail(\n+                    subject, message, settings.DEFAULT_FROM_EMAIL, [conf.email]\n+                )\n             except smtplib.SMTPException:\n                 context['confirmation'] = None\n-                context['error'] = ('An error occurred during registration. '\n-                                    'Please try again later')\n+                context['error'] = (\n+                    'An error occurred during registration. '\n+                    'Please try again later'\n+                )\n     else:\n         form = RegistrationForm()\n \n@@ -83,8 +89,7 @@ def register_confirm(request, conf):\n     try:\n         person = Person.objects.get(email__iexact=conf.user.email)\n     except Person.DoesNotExist:\n-        person = Person(email=conf.user.email,\n-                        name=conf.user.profile.name)\n+        person = Person(email=conf.user.email, name=conf.user.profile.name)\n     person.user = conf.user\n     person.save()\n \n@@ -94,8 +99,9 @@ def register_confirm(request, conf):\n @login_required\n def profile(request):\n     if request.method == 'POST':\n-        form = UserProfileForm(instance=request.user.profile,\n-                               data=request.POST)\n+        form = UserProfileForm(\n+            instance=request.user.profile, data=request.POST\n+        )\n         if form.is_valid():\n             form.save()\n     else:\n@@ -115,9 +121,11 @@ def profile(request):\n         Person._meta.db_table,\n         Person._meta.get_field('email').column,\n         EmailOptout._meta.get_field('email').column,\n-        EmailOptout._meta.db_table)\n-    people = Person.objects.filter(user=request.user) \\\n-        .extra(select={'is_optout': optout_query})\n+        EmailOptout._meta.db_table,\n+    )\n+    people = Person.objects.filter(user=request.user).extra(\n+        select={'is_optout': optout_query}\n+    )\n     context['linked_emails'] = people\n     context['linkform'] = EmailForm()\n     context['api_token'] = request.user.profile.token\n@@ -134,25 +142,32 @@ def link(request):\n     if request.method == 'POST':\n         form = EmailForm(request.POST)\n         if form.is_valid():\n-            conf = EmailConfirmation(type='userperson',\n-                                     user=request.user,\n-                                     email=form.cleaned_data['email'])\n+            conf = EmailConfirmation(\n+                type='userperson',\n+                user=request.user,\n+                email=form.cleaned_data['email'],\n+            )\n             conf.save()\n \n             context['confirmation'] = conf\n \n             subject = render_to_string('patchwork/mails/user-link-subject.txt')\n-            message = render_to_string('patchwork/mails/user-link.txt',\n-                                       context, request=request)\n+            message = render_to_string(\n+                'patchwork/mails/user-link.txt', context, request=request\n+            )\n             try:\n-                send_mail(subject,\n-                          message,\n-                          settings.DEFAULT_FROM_EMAIL,\n-                          [form.cleaned_data['email']])\n+                send_mail(\n+                    subject,\n+                    message,\n+                    settings.DEFAULT_FROM_EMAIL,\n+                    [form.cleaned_data['email']],\n+                )\n             except smtplib.SMTPException:\n                 context['confirmation'] = None\n-                context['error'] = ('An error occurred during confirmation. '\n-                                    'Please try again later')\n+                context['error'] = (\n+                    'An error occurred during confirmation. '\n+                    'Please try again later'\n+                )\n     else:\n         form = EmailForm()\n \n@@ -205,7 +220,9 @@ def todo_lists(request):\n         return HttpResponseRedirect(\n             reverse(\n                 'user-todo',\n-                kwargs={'project_id': todo_lists[0]['project'].linkname}))\n+                kwargs={'project_id': todo_lists[0]['project'].linkname},\n+            )\n+        )\n \n     context = {\n         'todo_lists': todo_lists,\n@@ -218,19 +235,22 @@ def todo_lists(request):\n def todo_list(request, project_id):\n     project = get_object_or_404(Project, linkname=project_id)\n     patches = request.user.profile.todo_patches(project=project)\n-    filter_settings = [(DelegateFilter,\n-                        {'delegate': request.user})]\n+    filter_settings = [(DelegateFilter, {'delegate': request.user})]\n \n     # TODO(stephenfin): Build the context dict here\n-    context = generic_list(request, project,\n-                           'user-todo',\n-                           view_args={'project_id': project.linkname},\n-                           filter_settings=filter_settings,\n-                           patches=patches)\n+    context = generic_list(\n+        request,\n+        project,\n+        'user-todo',\n+        view_args={'project_id': project.linkname},\n+        filter_settings=filter_settings,\n+        patches=patches,\n+    )\n \n     context['bundles'] = request.user.bundles.all()\n     context['action_required_states'] = State.objects.filter(\n-        action_required=True).all()\n+        action_required=True\n+    ).all()\n \n     return render(request, 'patchwork/todo-list.html', context)\n \ndiff --git patchwork/views/utils.py patchwork/views/utils.py\nindex 4631229b..1f7ee0da 100644\n--- patchwork/views/utils.py\n+++ patchwork/views/utils.py\n@@ -28,8 +28,9 @@ class PatchMbox(MIMENonMultipart):\n     patch_charset = 'utf-8'\n \n     def __init__(self, _text):\n-        MIMENonMultipart.__init__(self, 'text', 'plain',\n-                                  **{'charset': self.patch_charset})\n+        MIMENonMultipart.__init__(\n+            self, 'text', 'plain', **{'charset': self.patch_charset}\n+        )\n         self.set_payload(_text.encode(self.patch_charset))\n         encode_7or8bit(self)\n \n@@ -79,9 +80,12 @@ def _submission_to_mbox(submission):\n     utc_timestamp = delta.seconds + delta.days * 24 * 3600\n \n     mail = PatchMbox(body)\n-    mail['X-Patchwork-Submitter'] = email.utils.formataddr((\n-        str(Header(submission.submitter.name, mail.patch_charset)),\n-        submission.submitter.email))\n+    mail['X-Patchwork-Submitter'] = email.utils.formataddr(\n+        (\n+            str(Header(submission.submitter.name, mail.patch_charset)),\n+            submission.submitter.email,\n+        )\n+    )\n     mail['X-Patchwork-Id'] = str(submission.id)\n     if is_patch and submission.delegate:\n         mail['X-Patchwork-Delegate'] = str(submission.delegate.email)\n@@ -152,13 +156,15 @@ def series_patch_to_mbox(patch, series_id):\n                 'Patch does not have an associated series. This is '\n                 'because the patch was processed with an older '\n                 'version of Patchwork. It is not possible to '\n-                'provide dependencies for this patch.')\n+                'provide dependencies for this patch.'\n+            )\n     else:\n         try:\n             series_id = int(series_id)\n         except ValueError:\n-            raise Http404('Expected integer series value or *. Received: %r' %\n-                          series_id)\n+            raise Http404(\n+                'Expected integer series value or *. Received: %r' % series_id\n+            )\n \n         if patch.series.id != series_id:\n             raise Http404('Patch does not belong to series %d' % series_id)\n@@ -166,8 +172,9 @@ def series_patch_to_mbox(patch, series_id):\n     mbox = []\n \n     # get the series-ified patch\n-    for dep in patch.series.patches.filter(\n-            number__lt=patch.number).order_by('number'):\n+    for dep in patch.series.patches.filter(number__lt=patch.number).order_by(\n+        'number'\n+    ):\n         mbox.append(patch_to_mbox(dep))\n \n     mbox.append(patch_to_mbox(patch))\ndiff --git patchwork/views/xmlrpc.py patchwork/views/xmlrpc.py\nindex 6701bf20..2998729f 100644\n--- patchwork/views/xmlrpc.py\n+++ patchwork/views/xmlrpc.py\n@@ -24,15 +24,13 @@ from patchwork.models import State\n from patchwork.views.utils import patch_to_mbox\n \n \n-class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher,\n-                                XMLRPCDocGenerator):\n+class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher, XMLRPCDocGenerator):\n \n     server_name = 'Patchwork XML-RPC API'\n     server_title = 'Patchwork XML-RPC API v1 Documentation'\n \n     def __init__(self):\n-        SimpleXMLRPCDispatcher.__init__(self, allow_none=False,\n-                                        encoding=None)\n+        SimpleXMLRPCDispatcher.__init__(self, allow_none=False, encoding=None)\n         XMLRPCDocGenerator.__init__(self)\n \n         def _dumps(obj, *args, **kwargs):\n@@ -65,7 +63,7 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher,\n         if not header.startswith('Basic '):\n             raise Exception('Authentication scheme not supported')\n \n-        header = header[len('Basic '):].strip()\n+        header = header[len('Basic ') :].strip()\n \n         try:\n             decoded = base64.b64decode(header.encode('ascii')).decode('ascii')\n@@ -104,7 +102,8 @@ class PatchworkXMLRPCDispatcher(SimpleXMLRPCDispatcher,\n             # report exception back to server\n             response = self.dumps(\n                 xmlrpc_client.Fault(\n-                    1, '%s:%s' % (sys.exc_info()[0], sys.exc_info()[1])),\n+                    1, '%s:%s' % (sys.exc_info()[0], sys.exc_info()[1])\n+                ),\n             )\n \n         return response\n@@ -134,6 +133,7 @@ def xmlrpc(request):\n \n     return response\n \n+\n # decorator for XMLRPC methods. Setting login_required to true will call\n # the decorated function with a non-optional user as the first argument.\n \n@@ -147,15 +147,31 @@ def xmlrpc_method(login_required=False):\n \n \n # We allow most of the Django field lookup types for remote queries\n-LOOKUP_TYPES = ['iexact', 'contains', 'icontains', 'gt', 'gte', 'lt',\n-                'in', 'startswith', 'istartswith', 'endswith',\n-                'iendswith', 'range', 'year', 'month', 'day', 'isnull']\n+LOOKUP_TYPES = [\n+    'iexact',\n+    'contains',\n+    'icontains',\n+    'gt',\n+    'gte',\n+    'lt',\n+    'in',\n+    'startswith',\n+    'istartswith',\n+    'endswith',\n+    'iendswith',\n+    'range',\n+    'year',\n+    'month',\n+    'day',\n+    'isnull',\n+]\n \n \n #######################################################################\n # Helper functions\n #######################################################################\n \n+\n def project_to_dict(obj):\n     \"\"\"Serialize a project object.\n \n@@ -312,7 +328,7 @@ def patch_check_to_dict(obj):\n     return {\n         'state': obj.combined_check_state,\n         'total': len(obj.checks),\n-        'checks': [check_to_dict(check) for check in obj.checks]\n+        'checks': [check_to_dict(check) for check in obj.checks],\n     }\n \n \n@@ -320,6 +336,7 @@ def patch_check_to_dict(obj):\n # Public XML-RPC methods\n #######################################################################\n \n+\n def _get_objects(serializer, objects, max_count):\n     if max_count > 0:\n         return [serializer(x) for x in objects[:max_count]]\n@@ -416,8 +433,9 @@ def person_list(search_str=None, max_count=0):\n         of all persons if no filter given.\n     \"\"\"\n     if search_str:\n-        people = (Person.objects.filter(name__icontains=search_str) |\n-                  Person.objects.filter(email__icontains=search_str))\n+        people = Person.objects.filter(\n+            name__icontains=search_str\n+        ) | Person.objects.filter(email__icontains=search_str)\n     else:\n         people = Person.objects.all()\n \n@@ -625,8 +643,7 @@ def patch_get_by_project_hash(project, hash):\n         if any, else an empty dict.\n     \"\"\"\n     try:\n-        patch = Patch.objects.get(project__linkname=project,\n-                                  hash=hash)\n+        patch = Patch.objects.get(project__linkname=project, hash=hash)\n         return patch_to_dict(patch)\n     except Patch.DoesNotExist:\n         return {}\n@@ -860,8 +877,7 @@ def check_list(filt=None):\n         if parts[0] == 'user_id':\n             dfilter['user'] = Person.objects.filter(id=filt[key])[0]\n         if parts[0] == 'project_id':\n-            dfilter['patch__project'] = Project.objects.filter(\n-                id=filt[key])[0]\n+            dfilter['patch__project'] = Project.objects.filter(id=filt[key])[0]\n         elif parts[0] == 'patch_id':\n             dfilter['patch'] = Patch.objects.filter(id=filt[key])[0]\n         elif parts[0] == 'max_count':\n@@ -895,8 +911,9 @@ def check_get(check_id):\n \n \n @xmlrpc_method(login_required=True)\n-def check_create(user, patch_id, context, state, target_url=\"\",\n-                 description=\"\"):\n+def check_create(\n+    user, patch_id, context, state, target_url=\"\", description=\"\"\n+):\n     \"\"\"Add a Check to a patch.\n \n     **NOTE:** Authentication is required for this method.\n@@ -920,8 +937,14 @@ def check_create(user, patch_id, context, state, target_url=\"\",\n             break\n     else:\n         raise Exception(\"Invalid check state: %s\" % state)\n-    Check.objects.create(patch=patch, context=context, state=state, user=user,\n-                         target_url=target_url, description=description)\n+    Check.objects.create(\n+        patch=patch,\n+        context=context,\n+        state=state,\n+        user=user,\n+        target_url=target_url,\n+        description=description,\n+    )\n     return True\n \n \n",
    "prefixes": [
        "RFC",
        "v2",
        "08/19"
    ]
}