get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1516043,
    "url": "http://patchwork.ozlabs.org/api/patches/1516043/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/patchwork/patch/20210811213705.36293-20-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": "<20210811213705.36293-20-stephen@that.guru>",
    "list_archive_url": null,
    "date": "2021-08-11T21:37:05",
    "name": "[RFC,19/19] templates: Convert registration page",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": false,
    "hash": "ab6ddc8a53fdec2dba3db13a443e8ef74a7984c1",
    "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/20210811213705.36293-20-stephen@that.guru/mbox/",
    "series": [
        {
            "id": 257699,
            "url": "http://patchwork.ozlabs.org/api/series/257699/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/patchwork/list/?series=257699",
            "date": "2021-08-11T21:36:49",
            "name": "Integrate Bulma",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/257699/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1516043/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1516043/checks/",
    "tags": {},
    "related": [],
    "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 spf=pass (sender SPF authorized) smtp.mailfrom=lists.ozlabs.org\n (client-ip=2404:9400:2:0:216:3eff:fee1:b9f1; helo=lists.ozlabs.org;\n envelope-from=patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org;\n receiver=<UNKNOWN>)",
            "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=Bd8TZhCN;\n\tdkim-atps=neutral",
            "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=Bd8TZhCN;\n\tdkim-atps=neutral",
            "lists.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=that.guru\n (client-ip=136.175.108.195; helo=mail-108-mta195.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=Bd8TZhCN;\n dkim-atps=neutral"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org\n [IPv6:2404:9400:2:0:216:3eff:fee1:b9f1])\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 4GlPBf4czTz9sSs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Aug 2021 08:10:02 +1000 (AEST)",
            "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4GlPBf38Z3z306K\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Aug 2021 08:10:02 +1000 (AEST)",
            "from mail-108-mta195.mxroute.com (mail-108-mta195.mxroute.com\n [136.175.108.195])\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 4GlPBW08J1z3002\n for <patchwork@lists.ozlabs.org>; Thu, 12 Aug 2021 08:09:53 +1000 (AEST)",
            "from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)\n (Authenticated sender: mN4UYu2MZsgR)\n by mail-108-mta195.mxroute.com (ZoneMTA) with ESMTPSA id\n 17b3743b42f00074ba.002 for <patchwork@lists.ozlabs.org>\n (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);\n Wed, 11 Aug 2021 22:09:49 +0000"
        ],
        "X-Zone-Loop": "5c13e8e4a785430a74b8958eb41373770c7bfe5f4e3f",
        "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:Content-Type:MIME-Version:References:\n In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=qdlRo1V+zd4xAwbdc+JhWEn8B5Ald19SqFHmIiQebMk=; b=Bd8TZhCNWZNzZi6BGcSDAljVx+\n wJpuexv7nPjIvCdu34Q7DfEr+chxV+0fnXcucHGKOAEwsWUO88xBthDlRu7Uaz/YZt7490CiBh7w4\n U2Oyffksioh4ONFlupCy8GqS7hBjPQa1BiSZ8LDHbDSoP8Q60GJ9d77AEo1FB1o7W+N058IToytpd\n SDVikZc3sWexCnxsvjiYZOoGm2CLv2H6T4M8J5s9dsSzM/1298mFictrXysbCU7G8fECrlcGUOIgr\n jhC99In9L5vXgcLrLkubJSKnpPdiIuhk2wJzKlGXBStMYdceHyPiPGST4IdNqwXF+hJCXjUnCySX+\n RFnEqhOw==;",
        "From": "Stephen Finucane <stephen@that.guru>",
        "To": "patchwork@lists.ozlabs.org",
        "Subject": "[RFC PATCH 19/19] templates: Convert registration page",
        "Date": "Wed, 11 Aug 2021 22:37:05 +0100",
        "Message-Id": "<20210811213705.36293-20-stephen@that.guru>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210811213705.36293-1-stephen@that.guru>",
        "References": "<20210811213705.36293-1-stephen@that.guru>",
        "MIME-Version": "1.0",
        "X-AuthUser": "stephen@that.guru",
        "X-Zone-Spam-Resolution": "no action",
        "X-Zone-Spam-Status": "No, score=0.9, required=15, tests=[ARC_NA=0,\n MID_CONTAINS_FROM=1, FROM_HAS_DN=0, RCPT_COUNT_THREE=0, TO_DN_SOME=0,\n MIME_GOOD=-0.1, FROM_EQ_ENVFROM=0, MIME_TRACE=0, RCVD_COUNT_ZERO=0,\n NEURAL_SPAM=0]",
        "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=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Patchwork\"\n <patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"
    },
    "content": "This is the last of our non submission pages. There's nothing too tricky\nhere except that we no longer use this page for success, instead\ndirecting to the index page, and we remove a potential information leak\nfrom the registration form that could leak information about registered\nusers without authentication.\n\nNext up, the main patch and cover letter list/detail pages.\n\nSigned-off-by: Stephen Finucane <stephen@that.guru>\n---\n patchwork/forms.py                            |   7 +-\n .../templates/patchwork/registration.html     | 211 +++++++++---------\n patchwork/views/user.py                       |  15 +-\n 3 files changed, 120 insertions(+), 113 deletions(-)",
    "diff": "diff --git patchwork/forms.py patchwork/forms.py\nindex a975db18..b1b68179 100644\n--- patchwork/forms.py\n+++ patchwork/forms.py\n@@ -32,6 +32,7 @@ class RegistrationForm(forms.Form):\n             User.objects.get(username__iexact=value)\n         except User.DoesNotExist:\n             return self.cleaned_data['username']\n+\n         raise forms.ValidationError(\n             'This username is already taken. Please choose another.'\n         )\n@@ -39,12 +40,12 @@ class RegistrationForm(forms.Form):\n     def clean_email(self):\n         value = self.cleaned_data['email']\n         try:\n-            user = User.objects.get(email__iexact=value)\n+            User.objects.get(email__iexact=value)\n         except User.DoesNotExist:\n             return self.cleaned_data['email']\n+\n         raise forms.ValidationError(\n-            'This email address is already in use '\n-            'for the account \"%s\".\\n' % user.username\n+            'This email address is already in use for another account.'\n         )\n \n     def clean(self):\ndiff --git patchwork/templates/patchwork/registration.html patchwork/templates/patchwork/registration.html\nindex 8e2a3511..c9a2a94e 100644\n--- patchwork/templates/patchwork/registration.html\n+++ patchwork/templates/patchwork/registration.html\n@@ -1,113 +1,112 @@\n-{% extends \"base.html\" %}\n+{% extends \"base2.html\" %}\n \n {% block title %}Registration{% endblock %}\n-{% block heading %}Registration{% endblock %}\n+\n+{% block navigation %}{% endblock %}\n \n {% block body %}\n-{% if confirmation and not error %}\n-<p>\n-  Registration successful!\n-</p>\n-<p>\n-  A confirmation email has been sent to {{ confirmation.email }}.\n-  You'll need to visit the link provided in that email to confirm your\n-  registration.\n-</p>\n-{% else %}\n-<p>By creating a Patchwork account, you can:<p>\n-<ul>\n-  <li>create \"bundles\" of patches</li>\n-  <li>update the state of your own patches</li>\n-</ul>\n-<form method=\"post\">\n-  {% csrf_token %}\n-  <table class=\"form registerform\">\n-    <tr>\n-      <th colspan=\"2\" class=\"headerrow\">register</th>\n-    </tr>\n-{% if error %}\n-    <tr>\n-      <td colspan=\"2\">{{ error }}</td>\n-    </tr>\n-{% endif %}\n-    <tr>\n-      <td>{{ form.first_name.label_tag }}</td>\n-      <td>\n-{% if form.first_name.errors %}\n-        {{ form.first_name.errors }}\n-{% endif %}\n-        {{ form.first_name }}\n-{% if form.first_name.help_text %}\n-        <div class=\"help_text\"/>{{ form.first_name.help_text }}</div>\n-{% endif %}\n-      </td>\n-    </tr>\n-    <tr>\n-      <td>{{ form.last_name.label_tag }}</td>\n-      <td>\n-{% if form.last_name.errors %}\n-        {{ form.last_name.errors }}\n-{% endif %}\n-        {{ form.last_name }}\n-{% if form.last_name.help_text %}\n-        <div class=\"help_text\"/>{{ form.last_name.help_text }}</div>\n-{% endif %}\n-      </td>\n-    </tr>\n-    <tr>\n-      <td></td>\n-      <td class=\"form-help\">\n-        Your name is used to identify you on the site\n-      </td>\n-    </tr>\n-    <tr>\n-      <td>{{ form.email.label_tag }}</td>\n-      <td>\n-{% if form.email.errors %}\n-        {{ form.email.errors }}\n+<section class=\"hero is-primary is-fullheight\">\n+  <div class=\"hero-body\">\n+    <div class=\"container\">\n+      <div class=\"columns is-centered\">\n+        <div class=\"column is-6-tablet is-6-desktop is-6-widescreen\">\n+          <div class=\"block has-text-centered\">\n+            <h1 class=\"title is-3\">Create your Patchwork account</h1>\n+          </div>\n+{% if form.non_field_errors %}\n+          <div class=\"notification is-danger is-light\">\n+            <button class=\"delete\"></button>\n+            {{ form.non_field_errors }}\n+          </div>\n {% endif %}\n-        {{ form.email }}\n-{% if form.email.help_text %}\n-        <div class=\"help_text\"/>{{ form.email.help_text }}</div>\n-{% endif %}\n-      </td>\n-    </tr>\n-    <tr>\n-      <td></td>\n-      <td class=\"form-help\">\n-        Patchwork will send a confirmation email to this address\n-      </td>\n-    </tr>\n-    <tr>\n-      <td>{{ form.username.label_tag }}</td>\n-      <td>\n-{% if form.username.errors %}\n-        {{ form.username.errors }}\n-{% endif %}\n-        {{ form.username }}\n-{% if form.username.help_text %}\n-        <div class=\"help_text\"/>{{ form.username.help_text }}</div>\n-{% endif %}\n-      </td>\n-    </tr>\n-    <tr>\n-      <td>{{ form.password.label_tag }}</td>\n-      <td>\n-{% if form.password.errors %}\n-        {{ form.password.errors }}\n-{% endif %}\n-        {{ form.password }}\n-{% if form.password.help_text %}\n-        <div class=\"help_text\"/>{{ form.password.help_text }}</div>\n-{% endif %}\n-      </td>\n-    </tr>\n-    <tr>\n-      <td colspan=\"2\" class=\"submitrow\">\n-        <input type=\"submit\" value=\"Register\"/>\n-      </td>\n-    </tr>\n-  </table>\n-</form>\n+{% for message in messages %}\n+{% if message.tags == 'success' %}\n+          <div class=\"notification is-success is-light\">\n+{% elif message.tags == 'warning' %}\n+          <div class=\"notification is-warning is-light\">\n+{% elif message.tags == 'error' %}\n+          <div class=\"notification is-danger is-light\">\n+{% else %}\n+          <div class=\"notification is-light\">\n {% endif %}\n+            <button class=\"delete\" onclick=\"dismiss(this);\"></button>\n+            {{ message }}\n+          </div>\n+{% endfor %}\n+          <form method=\"post\" class=\"box\">\n+            {% csrf_token %}\n+            <div class=\"field\">\n+              <label for=\"id_username\" class=\"label has-text-weight-normal\">Username</label>\n+              <div class=\"control has-icons-left\">\n+                <input id=\"id_username\" type=\"text\" name=\"username\" placeholder=\"e.g. bobsmith\" class=\"input\" autocomplete=\"username\" autofocus required>\n+                <span class=\"icon is-small is-left\">\n+                  <i class=\"fa fa-user\"></i>\n+                </span>\n+              </div>\n+{% for error in form.username.errors %}\n+              <p class=\"help is-danger\">{{ error }}</p>\n+{% endfor %}\n+            </div>\n+            <div class=\"field\">\n+              <label for=\"id_email\" class=\"label has-text-weight-normal\">Email</label>\n+              <div class=\"control has-icons-left\">\n+                <input id=\"id_email\" type=\"email\" name=\"email\" placeholder=\"e.g. bobsmith@example.com\" class=\"input\" autocomplete=\"email\" autofocus required>\n+                <span class=\"icon is-small is-left\">\n+                  <i class=\"fa fa-envelope\"></i>\n+                </span>\n+              </div>\n+{% for error in form.email.errors %}\n+              <p class=\"help is-danger\">{{ error }}</p>\n+{% endfor %}\n+            </div>\n+            <div class=\"field\">\n+              <label for=\"id_first_name\" class=\"label has-text-weight-normal\">First name</label>\n+              <div class=\"control has-icons-left\">\n+                <input id=\"id_first_name\" type=\"text\" name=\"first_name\" class=\"input\" autocomplete=\"given-name\" autofocus required>\n+                <span class=\"icon is-small is-left\">\n+                </span>\n+              </div>\n+{% for error in form.first_name.errors %}\n+              <p class=\"help is-danger\">{{ error }}</p>\n+{% endfor %}\n+            </div>\n+            <div class=\"field\">\n+              <label for=\"id_last_name\" class=\"label has-text-weight-normal\">Last name</label>\n+              <div class=\"control has-icons-left\">\n+                <input id=\"id_last_name\" type=\"text\" name=\"last_name\" class=\"input\" autocomplete=\"family-name\" autofocus required>\n+                <span class=\"icon is-small is-left\">\n+                </span>\n+              </div>\n+{% for error in form.last_name.errors %}\n+              <p class=\"help is-danger\">{{ error }}</p>\n+{% endfor %}\n+            </div>\n+            <div class=\"field\">\n+              <label for=\"id_password\" class=\"label has-text-weight-normal\">Password</label>\n+              <div class=\"control has-icons-left\">\n+                <input id=\"id_password\" type=\"password\" name=\"password\" placeholder=\"*******\" class=\"input\" autocomplete=\"current-password\" required>\n+                <span class=\"icon is-small is-left\">\n+                  <i class=\"fa fa-lock\"></i>\n+                </span>\n+              </div>\n+{% for error in form.password.errors %}\n+              <p class=\"help is-danger\">{{ error }}</p>\n+{% endfor %}\n+            </div>\n+            <div class=\"field\">\n+              <button class=\"button is-success is-fullwidth\">\n+                Sign up\n+              </button>\n+            </div>\n+          </form>\n+          <div class=\"box has-text-centered\">\n+            <a href=\"{% url 'auth_login' %}\">Log in</a>\n+            &nbsp;•&nbsp;\n+            <a href=\"{% url 'password_reset' %}\">Forgot Password</a>\n+          </div>\n+        </div>\n+      </div>\n+    </div>\n+  </div>\n+</section>\n {% endblock %}\ndiff --git patchwork/views/user.py patchwork/views/user.py\nindex 973061b7..8a5bc276 100644\n--- patchwork/views/user.py\n+++ patchwork/views/user.py\n@@ -81,11 +81,18 @@ def register(request):\n                     [confirmation.email]\n                 )\n             except smtplib.SMTPException:\n-                context['confirmation'] = None\n-                context['error'] = (\n-                    'An error occurred during registration. '\n-                    'Please try again later'\n+                messages.error(\n+                    request,\n+                    'An error occurred while submitting this request. '\n+                    'Please contact an administrator.'\n+                )\n+            else:\n+                messages.success(\n+                    request,\n+                    'Succesfully signed up. '\n+                    'Check your email for confirmation.',\n                 )\n+                return HttpResponseRedirect(reverse('project-list'))\n     else:\n         form = RegistrationForm()\n \n",
    "prefixes": [
        "RFC",
        "19/19"
    ]
}