@@ -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):
@@ -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 = 'noreply@example.com'
-LOGIN_REDIRECT_URL = '/Errors'
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
@@ -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 = 'noreply@example.com'
-LOGIN_REDIRECT_URL = '/Errors'
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
@@ -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"),
@@ -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
@@ -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}}">
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -1,14 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block content %}
-
-{% blocktrans %}
-
-Activation is complete.
-<br/>
-You can log in now.
-
-{% endblocktrans %}
-
-{% endblock %}
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -1 +0,0 @@
-{% load i18n %}{% trans "Account activation on" %} {{ site.name }}
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -1,6 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block content %}
-<p>{% trans "Logged out" %}</p>
-{% endblock %}
deleted file mode 100644
@@ -1,6 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block content %}
-<p>{% trans "Password changed" %}</p>
-{% endblock %}
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -1,6 +0,0 @@
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block content %}
-<p>{% trans "An email with password reset instructions has been sent." %}</p>
-{% endblock %}
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -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>
deleted file mode 100644
@@ -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 %}
deleted file mode 100644
@@ -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 %}
Registration 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 Signed-off-by: Tim Orling <tim.orling@konsulko.com> --- 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