Minor fixes; drop broken account pages
cover Minor fixes; drop broken account pages
* common_context was not being applied, so fix that.
* The account pages were broken and are not used in production, so remove them. If someone wants that feature, we can add them back but we will need to fix them and more importantly add tests.
* Align the README with sending patches to yocto-patches mailing list.
Tim Orling (3):
Apply common_context through TEMPLATES.
Remove the broken account pages.
README: update where to send patches
Post/test.py | 21 +++++++++++++++++++ README | 10 ++++++--- project/settings.py | 10 +-------- project/settings.py.docker | 10 +-------- project/urls.py | 3 +-- requirements.txt | 1 - templates/base.html | 21 ------------------- templates/registration/activate.html | 18 ---------------- .../registration/activation_complete.html | 14 ------------- templates/registration/activation_email.txt | 14 ------------- .../registration/activation_email_subject.txt | 1 - templates/registration/login.html | 18 ---------------- templates/registration/logout.html | 6 ------ .../registration/password_change_done.html | 6 ------ .../registration/password_change_form.html | 11 ---------- .../registration/password_reset_complete.html | 10 --------- .../registration/password_reset_confirm.html | 21 ------------------- .../registration/password_reset_done.html | 6 ------ .../registration/password_reset_email.html | 5 ----- .../registration/password_reset_form.html | 14 ------------- templates/registration/registration_base.html | 12 ----------- .../registration/registration_complete.html | 6 ------ templates/registration/registration_form.html | 15 ------------- 23 files changed, 31 insertions(+), 222 deletions(-) delete mode 100644 templates/registration/activate.html delete mode 100644 templates/registration/activation_complete.html delete mode 100644 templates/registration/activation_email.txt delete mode 100644 templates/registration/activation_email_subject.txt delete mode 100644 templates/registration/login.html delete mode 100644 templates/registration/logout.html delete mode 100644 templates/registration/password_change_done.html delete mode 100644 templates/registration/password_change_form.html delete mode 100644 templates/registration/password_reset_complete.html delete mode 100644 templates/registration/password_reset_confirm.html delete mode 100644 templates/registration/password_reset_done.html delete mode 100644 templates/registration/password_reset_email.html delete mode 100644 templates/registration/password_reset_form.html delete mode 100644 templates/registration/registration_base.html delete mode 100644 templates/registration/registration_complete.html delete mode 100644 templates/registration/registration_form.html
base-commit: 752b7188d04c2fd0e2f32f0cd2dd437c43058d82
prerequisite-patch-id: 9c9d012e1163dd1d335531d0451657823f17eb64
prerequisite-patch-id: ddb4df3e54736ed25846f91d4918299e601f4071
prerequisite-patch-id: ab69f4aa494291611cbe0e916f18b07f4aeebe57
prerequisite-patch-id: ac2b802ea065536df3854c48e265f5508d201cff
prerequisite-patch-id: 81a7de0e9568848efc8c66d397abb5f56218db95
prerequisite-patch-id: cf32dcaef20903890a020211a35f46b2384207da
prerequisite-patch-id: 6920bc5c70071bbd42b55b08bfc2bff04133c3ab
prerequisite-patch-id: a72bee4356db80ccb45321967d18081961f60860
Signature · 1 line
2.56.0
PATCH 1/3 Apply common_context through TEMPLATES.
TEMPLATE_CONTEXT_PROCESSORS has been ignored since Django 1.10, so common_context never ran and the SPECIAL_SUBMITTER tab never showed.
AI-Generated: Claude Opus 5.5
--- Post/test.py | 11 +++++++++++ project/settings.py | 7 +------ project/settings.py.docker | 7 +------ 3 files changed, 13 insertions(+), 12 deletions(-)
Post/test.py +11 -0
@@ -400,6 +400,17 @@ class PaginationTest(TestCase): self.assertEqual(response.status_code, 200) +@override_settings(ALLOWED_HOSTS=["testhost"]) +class SpecialSubmitterTest(TestCase): + def test_tab_shown_only_when_configured(self): + client = Client(HTTP_HOST="testhost") + self.assertNotContains(client.get("/Errors/Latest/"), "Latest Autobuilder errors") + with self.settings(SPECIAL_SUBMITTER={"name": "yocto-autobuilder", + "title": "Autobuilder", + "link": "Autobuilder"}): + self.assertContains(client.get("/Errors/Latest/"), "Latest Autobuilder errors") + + @patch("Post.management.commands.culldb.time.sleep") class CullDbTest(TestCase): def setUp(self):
project/settings.py +1 -6
@@ -159,6 +159,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'Post.views.common_context', ], }, },
@@ -208,12 +209,6 @@ LOGGING = { } } -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.request', - 'Post.views.common_context', -) - BUGZILLA_URL = 'https://bugzilla.yoctoproject.org' ACCOUNT_ACTIVATION_DAYS = 2
project/settings.py.docker +1 -6
@@ -153,6 +153,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'Post.views.common_context', ], }, },
@@ -202,12 +203,6 @@ LOGGING = { } } -TEMPLATE_CONTEXT_PROCESSORS = ( - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.request', - 'Post.views.common_context', -) - BUGZILLA_URL = 'https://bugzilla.yoctoproject.org' ACCOUNT_ACTIVATION_DAYS = 2
Signature · 1 line
2.56.0
PATCH 2/3 Remove the broken account pages.
In reply to Tim OrlingRegistration and activation returned 500, login 404, and the login links were commented out. Nothing needs a login; the admin has its own. Remove the URLs, templates, settings and django-registration.
AI-Generated: Claude Opus 5.5
--- Post/test.py | 10 +++++++++ project/settings.py | 3 --- project/settings.py.docker | 3 --- project/urls.py | 3 +-- requirements.txt | 1 - templates/base.html | 21 ------------------- templates/registration/activate.html | 18 ---------------- .../registration/activation_complete.html | 14 ------------- templates/registration/activation_email.txt | 14 ------------- .../registration/activation_email_subject.txt | 1 - templates/registration/login.html | 18 ---------------- templates/registration/logout.html | 6 ------ .../registration/password_change_done.html | 6 ------ .../registration/password_change_form.html | 11 ---------- .../registration/password_reset_complete.html | 10 --------- .../registration/password_reset_confirm.html | 21 ------------------- .../registration/password_reset_done.html | 6 ------ .../registration/password_reset_email.html | 5 ----- .../registration/password_reset_form.html | 14 ------------- templates/registration/registration_base.html | 12 ----------- .../registration/registration_complete.html | 6 ------ templates/registration/registration_form.html | 15 ------------- 22 files changed, 11 insertions(+), 207 deletions(-) delete mode 100644 templates/registration/activate.html delete mode 100644 templates/registration/activation_complete.html delete mode 100644 templates/registration/activation_email.txt delete mode 100644 templates/registration/activation_email_subject.txt delete mode 100644 templates/registration/login.html delete mode 100644 templates/registration/logout.html delete mode 100644 templates/registration/password_change_done.html delete mode 100644 templates/registration/password_change_form.html delete mode 100644 templates/registration/password_reset_complete.html delete mode 100644 templates/registration/password_reset_confirm.html delete mode 100644 templates/registration/password_reset_done.html delete mode 100644 templates/registration/password_reset_email.html delete mode 100644 templates/registration/password_reset_form.html delete mode 100644 templates/registration/registration_base.html delete mode 100644 templates/registration/registration_complete.html delete mode 100644 templates/registration/registration_form.html
Post/test.py +10 -0
@@ -411,6 +411,16 @@ class SpecialSubmitterTest(TestCase): self.assertContains(client.get("/Errors/Latest/"), "Latest Autobuilder errors") +@override_settings(ALLOWED_HOSTS=["testhost"]) +class AccountPagesRemovedTest(TestCase): + def test_accounts_urls_are_gone(self): + client = Client(HTTP_HOST="testhost") + for url in ("/accounts/register/", "/accounts/login/"): + self.assertEqual(client.get(url).status_code, 404) + # The admin keeps its own login page. + self.assertEqual(client.get("/admin/login/").status_code, 200) + + @patch("Post.management.commands.culldb.time.sleep") class CullDbTest(TestCase): def setUp(self):
project/settings.py +0 -3
@@ -177,7 +177,6 @@ INSTALLED_APPS = ( 'django.contrib.admin', # Uncomment the next line to enable admin documentation: 'django.contrib.admindocs', - # 'registration', ) # A sample logging configuration. The only tangible logging
@@ -211,10 +210,8 @@ LOGGING = { BUGZILLA_URL = 'https://bugzilla.yoctoproject.org' -ACCOUNT_ACTIVATION_DAYS = 2 EMAIL_HOST = 'localhost' DEFAULT_FROM_EMAIL = '[email protected]' -LOGIN_REDIRECT_URL = '/Errors' TEST_RUNNER = 'django.test.runner.DiscoverRunner' DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
project/settings.py.docker +0 -3
@@ -171,7 +171,6 @@ INSTALLED_APPS = ( 'django.contrib.admin', # Uncomment the next line to enable admin documentation: 'django.contrib.admindocs', - # 'registration', ) # A sample logging configuration. The only tangible logging
@@ -205,10 +204,8 @@ LOGGING = { BUGZILLA_URL = 'https://bugzilla.yoctoproject.org' -ACCOUNT_ACTIVATION_DAYS = 2 EMAIL_HOST = 'localhost' DEFAULT_FROM_EMAIL = '[email protected]' -LOGIN_REDIRECT_URL = '/Errors' TEST_RUNNER = 'django.test.runner.DiscoverRunner' DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
project/urls.py +1 -2
@@ -6,7 +6,7 @@ # # Licensed under the MIT license, see COPYING.MIT for details -from django.urls import include, re_path +from django.urls import re_path from django.contrib import admin from django.views.generic import TemplateView, RedirectView from django.conf import settings
@@ -26,7 +26,6 @@ urlpatterns = [ # Uncomment the next line to enable the admin: re_path(r'^admin/', admin.site.urls), - re_path(r'^accounts/', include('django_registration.backends.activation.urls')), re_path(r'^Errors/Latest/$', post_views.search, { 'mode' : results_mode.LATEST }, name= "latest_errors"), re_path(r'^Errors/Latest/feed$', LatestEntriesFeed(), name="errors_feed"), re_path(r'^Errors/Latest/'+special_submitter+'/$', post_views.search, { 'mode' : results_mode.SPECIAL_SUBMITTER}, name= "latest_autobuilder_errors"),
requirements.txt +0 -1
@@ -2,4 +2,3 @@ Django>=5.2.18,<5.3 python-Levenshtein==0.27.4 bleach==6.4.0 mysqlclient==2.3.0 -django-registration==5.2.1
templates/base.html +0 -21
@@ -31,27 +31,6 @@ Licensed under the MIT license, see COPYING.MIT for details <div class="container-fluid"> <a class="brand logo" href="{% url "main" %}"><img src="{% static "img/logo.png" %}" /></a> <a class="brand" href="{% url "main" %}">Error reports</a> - {% comment %} - {% if user.is_authenticated %} - <div class="dropdown pull-right"> - <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> - <i class="icon-user"></i>{{ user.username }} - <b class="caret pull-right"></b> - </a> - <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel"> - <li><a tabindex="-1" href="{% url "auth_password_change" %}">{% trans "Change password" %}</a></li> - <li><a tabindex="-1" href="{% url "auth_logout" %}">{% trans "Log out" %}</a></li> - </ul> - </div> - {% endif %} - {% if not user.is_authenticated %} - <ul class="nav pull-right"> - <li> - <a href="{% url "auth_login" %}">{% trans "log in" %}</a> - </li> - </ul> - {% endif %} - {% endcomment %} <form class="navbar-search pull-right" action="{% url "errors_search" %}" method="GET"> <div class="input-append"> <input type="text" name="query" class="span5" placeholder="Search all errors" value="{{request.GET.query}}">
templates/registration/activate.html deleted +0 -18
@@ -1,18 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} - -{% if account %} - -<p>{% trans "Account successfully activated" %}</p> - -<p><a href="{% url "auth_login" %}">{% trans "Log in" %}</a></p> - -{% else %} - -<p>{% trans "Account activation failed" %}</p> - -{% endif %} - -{% endblock %}
templates/registration/activation_complete.html deleted +0 -14
@@ -1,14 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} - -{% blocktrans %} - -Activation is complete. -<br/> -You can log in now. - -{% endblocktrans %} - -{% endblock %}
templates/registration/activation_email.txt deleted +0 -14
@@ -1,14 +0,0 @@ -{% load i18n %} -{% blocktrans with site.name as site_name %} -A request has been made to activate an account at {{ site_name }} using your email address. - -If you made this request, please click on the link below to activate your account. The -link is valid for {{ expiration_days }} days. - -{% endblocktrans %} - -http://{{ site.domain }}{% url "registration_activate" activation_key %} - -{% blocktrans %} -If you did not make this request, please ignore this message. -{% endblocktrans %}
templates/registration/activation_email_subject.txt deleted +0 -1
@@ -1 +0,0 @@ -{% load i18n %}{% trans "Account activation on" %} {{ site.name }}
templates/registration/login.html deleted +0 -18
@@ -1,18 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<div class="page-header"> - <h1>Log in to the error reporting tool</h1> -</div> -<form id="login_form" method="post" action="."> - {{ form.as_p }} - - <input type="submit" class="btn" value="{% trans 'Log in' %}" /> - <input type="hidden" name="next" value="{{ next }}" /> - {% csrf_token %} -</form> - -<p>{% trans "Forgot password" %}? <a href="{% url "auth_password_reset" %}">{% trans "Reset it" %}</a>!</p> -<p>{% trans "Don't have an account" %}? <a href="{% url "registration_register" %}">{% trans "Create one now" %}</a>!</p> -{% endblock %}
templates/registration/logout.html deleted +0 -6
@@ -1,6 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<p>{% trans "Logged out" %}</p> -{% endblock %}
templates/registration/password_change_done.html deleted +0 -6
@@ -1,6 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<p>{% trans "Password changed" %}</p> -{% endblock %}
templates/registration/password_change_form.html deleted +0 -11
@@ -1,11 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<form method="post" action="."> - {{ form.as_p }} - - <input type="submit" class="btn" value="{% trans 'Submit' %}" /> - {% csrf_token %} -</form> -{% endblock %}
templates/registration/password_reset_complete.html deleted +0 -10
@@ -1,10 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} - -<p>{% trans "Password reset successfully" %}</p> - -<p><a href="{% url "auth_login" %}">{% trans "Log in" %}</a></p> - -{% endblock %}
templates/registration/password_reset_confirm.html deleted +0 -21
@@ -1,21 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} - -{% if validlink %} - -<form id="password_form" method="post" action="."> - {{ form.as_p }} - - <input type="submit" class="btn" value="{% trans 'Submit' %}" /> - {% csrf_token %} -</form> - -{% else %} - -<p>{% trans "Password reset failed" %}</p> - -{% endif %} - -{% endblock %}
templates/registration/password_reset_done.html deleted +0 -6
@@ -1,6 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<p>{% trans "An email with password reset instructions has been sent." %}</p> -{% endblock %}
templates/registration/password_reset_email.html deleted +0 -5
@@ -1,5 +0,0 @@ -{% load i18n %} -{% blocktrans %}Reset password at {{ site_name }}{% endblocktrans %}: -{% block reset_link %} -{{ protocol }}://{{ domain }}{% url "auth_password_reset_confirm" uidb36=uid, token=token %} -{% endblock %}
templates/registration/password_reset_form.html deleted +0 -14
@@ -1,14 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<div class="page-header"> - <h1>Reset your password</h1> -</div> -<form id="password_form" method="post" action="."> - {{ form.as_p }} - - <input type="submit" class="btn" value="{% trans 'Submit' %}" /> - {% csrf_token %} -</form> -{% endblock %}
templates/registration/registration_base.html deleted +0 -12
@@ -1,12 +0,0 @@ - {% load i18n %} - -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> - -<body> - - <a href="{% url "auth_login" %}">{% trans "log in" %}</a> - -</body> -</html>
templates/registration/registration_complete.html deleted +0 -6
@@ -1,6 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<p>{% trans "Your account has been created, however it must now be activated. An email has been sent with instructions on how to activate your account." %}</p> -{% endblock %}
templates/registration/registration_form.html deleted +0 -15
@@ -1,15 +0,0 @@ -{% extends "base.html" %} -{% load i18n %} - -{% block content %} -<div class="page-header"> - <h1>Create an account</h1> -</div> - -<form id="registration_form" method="post" action="."> - {{ form.as_p }} - - <input type="submit" class="btn" value="{% trans 'Submit' %}" /> - {% csrf_token %} -</form> -{% endblock %}
Signature · 1 line
2.56.0
PATCH 3/3 README: update where to send patches
In reply to Tim OrlingPatches go to yocto-patches, and the repository is served over https. Show the git config for send-email.
AI-Generated: Claude Opus 5.5
--- README | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
README +7 -3
@@ -80,10 +80,14 @@ The code for this application is maintained by the Yocto Project. The latest version can be checked out by git cloning: - git://git.yoctoproject.org/error-report-web + https://git.yoctoproject.org/error-report-web -Contributions are welcome. Please send patches / pull requests to [email protected] with '[error-report-web]' in the subject. +Contributions are welcome. Please send patches with git send-email to [email protected] with '[error-report-web]' in the +subject. To set this up in your clone: + + git config format.subjectPrefix "error-report-web][PATCH" + git config sendemail.to [email protected] To manage the size of your database there is a convenience command:
Signature · 1 line
2.56.0