Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/1523349/?format=api
{ "id": 1523349, "url": "http://patchwork.ozlabs.org/api/patches/1523349/?format=api", "web_url": "http://patchwork.ozlabs.org/project/patchwork/patch/20210901165756.181192-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": "<20210901165756.181192-20-stephen@that.guru>", "list_archive_url": null, "date": "2021-09-01T16:57:56", "name": "[RFC,v2,19/19] templates: Convert registration template", "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/20210901165756.181192-20-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/1523349/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/1523349/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\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=njBln7Z9;\n\tdkim-atps=neutral", "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>)", "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=njBln7Z9;\n\tdkim-atps=neutral", "lists.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=that.guru\n (client-ip=136.175.108.113; helo=mail-108-mta113.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=njBln7Z9;\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 4H09jR1YKgz9sW8\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 2 Sep 2021 03:17:31 +1000 (AEST)", "from boromir.ozlabs.org (localhost [IPv6:::1])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 4H09jR07B0z30KC\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 2 Sep 2021 03:17:31 +1000 (AEST)", "from mail-108-mta113.mxroute.com (mail-108-mta113.mxroute.com\n [136.175.108.113])\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 4H09ht0hKFz2yS1\n for <patchwork@lists.ozlabs.org>; Thu, 2 Sep 2021 03:17:01 +1000 (AEST)", "from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)\n (Authenticated sender: mN4UYu2MZsgR)\n by mail-108-mta113.mxroute.com (ZoneMTA) with ESMTPSA id\n 17ba25d145900074ba.001 for <patchwork@lists.ozlabs.org>\n (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);\n Wed, 01 Sep 2021 17:16:54 +0000" ], "X-Zone-Loop": "26e84cb4028bf665ab151150e797cff80f6de9b960c9", "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=A3VXjTJ+RXeufDjssSn9M/sw6rtsZobyNiuZmggkG2Q=; b=njBln7Z9ieTd4JYFv/OR9J601x\n IRuYogPa/tmD84bwBptEYCUSUSGAY47Vl3ks7nlRBmhUDbeh5x/EMbJU4DasnGybtb2VVMmzGTR6y\n spIu/rtp0CjDF64tAZiRDlcw7x1U8PUBYZTJKAVRHr71xZVcNIfrTESw4dt0ys9w2AeTDjPhpz89Y\n 9JAvTnaWQg9g4TKfUo6Kj2jJyUHLmwGDkXX1KhzvHu1zC2F0I4pg0qtqvY2Ko29fKXtdaAPhcZgaZ\n hY3h3jNXmnO5hkMUnro+4dvySahL2AcC1lqsFqoklNNwIeAaFgUtULl3ATRfm4nAK+m8lOdgEuhUF\n 3QdNTD1w==;", "From": "Stephen Finucane <stephen@that.guru>", "To": "patchwork@lists.ozlabs.org", "Subject": "[RFC PATCH v2 19/19] templates: Convert registration template", "Date": "Wed, 1 Sep 2021 17:57:56 +0100", "Message-Id": "<20210901165756.181192-20-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=\"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. Next up, the main patch\nand 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+ • \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", "v2", "19/19" ] }