From 50180c96844e66f1e68bb9c3fbabfd9827943c87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sascha=20I=C3=9Fbr=C3=BCcker?= Date: Mon, 5 Jan 2026 05:52:43 +0100 Subject: [PATCH] Remove registration switch (#1268) --- bookmarks/settings/base.py | 3 -- bookmarks/settings/custom.py | 2 - .../registration_complete.html | 12 ------ .../registration_form.html | 39 ------------------- bookmarks/templates/registration/login.html | 3 -- bookmarks/urls.py | 12 ------ bookmarks/views/auth.py | 1 - pyproject.toml | 1 - scripts/run-docker.sh | 2 +- uv.lock | 24 ------------ 10 files changed, 1 insertion(+), 98 deletions(-) delete mode 100644 bookmarks/templates/django_registration/registration_complete.html delete mode 100644 bookmarks/templates/django_registration/registration_form.html diff --git a/bookmarks/settings/base.py b/bookmarks/settings/base.py index 4640ab6..53993b4 100644 --- a/bookmarks/settings/base.py +++ b/bookmarks/settings/base.py @@ -136,9 +136,6 @@ REST_FRAMEWORK = { "PAGE_SIZE": 100, } -# Registration switch -ALLOW_REGISTRATION = False - # URL validation flag LD_DISABLE_URL_VALIDATION = os.getenv("LD_DISABLE_URL_VALIDATION", False) in ( True, diff --git a/bookmarks/settings/custom.py b/bookmarks/settings/custom.py index 143330e..fcfe4e5 100644 --- a/bookmarks/settings/custom.py +++ b/bookmarks/settings/custom.py @@ -1,3 +1 @@ # Placeholder, can be mounted in a Docker container with a custom settings - -# ALLOW_REGISTRATION = True diff --git a/bookmarks/templates/django_registration/registration_complete.html b/bookmarks/templates/django_registration/registration_complete.html deleted file mode 100644 index 74d5d39..0000000 --- a/bookmarks/templates/django_registration/registration_complete.html +++ /dev/null @@ -1,12 +0,0 @@ -{% extends 'shared/layout.html' %} -{% block head %} - {% with page_title="Registration complete - Linkding" %}{{ block.super }}{% endwith %} -{% endblock %} -{% block content %} -
-
-

Registration complete

-
-

You can now use the application.

-
-{% endblock %} diff --git a/bookmarks/templates/django_registration/registration_form.html b/bookmarks/templates/django_registration/registration_form.html deleted file mode 100644 index aa6af8d..0000000 --- a/bookmarks/templates/django_registration/registration_form.html +++ /dev/null @@ -1,39 +0,0 @@ -{% extends 'shared/layout.html' %} -{% block head %} - {% with page_title="Registration - Linkding" %}{{ block.super }}{% endwith %} -{% endblock %} -{% block content %} -
-
-

Register

-
-
- {% csrf_token %} -
- - {{ form.username }} -
{{ form.errors.username }}
-
-
- - {{ form.email }} -
{{ form.errors.email }}
-
-
- - {{ form.password1 }} -
{{ form.errors.password1 }}
-
-
- - {{ form.password2 }} -
{{ form.errors.password2 }}
-
-
- - -
-
-{% endblock %} diff --git a/bookmarks/templates/registration/login.html b/bookmarks/templates/registration/login.html index 16bbcb0..d899835 100644 --- a/bookmarks/templates/registration/login.html +++ b/bookmarks/templates/registration/login.html @@ -30,9 +30,6 @@ href="{% url 'oidc_authentication_init' %}" data-turbo="false">Login with OIDC {% endif %} - {% if allow_registration %} - Register - {% endif %} diff --git a/bookmarks/urls.py b/bookmarks/urls.py index 533c1d1..214917a 100644 --- a/bookmarks/urls.py +++ b/bookmarks/urls.py @@ -158,18 +158,6 @@ if settings.LD_ENABLE_OIDC: # import debug_toolbar # urlpatterns.append(path("__debug__/", include(debug_toolbar.urls))) -# Registration -if settings.ALLOW_REGISTRATION: - from django_registration.backends.one_step.views import RegistrationView - - urlpatterns.append( - path( - "accounts/register/", - RegistrationView.as_view(), - name="django_registration_register", - ) - ) - # Context path if settings.LD_CONTEXT_PATH: urlpatterns = [path(settings.LD_CONTEXT_PATH, include(urlpatterns))] diff --git a/bookmarks/views/auth.py b/bookmarks/views/auth.py index c1d5b8a..3a3b90c 100644 --- a/bookmarks/views/auth.py +++ b/bookmarks/views/auth.py @@ -18,7 +18,6 @@ class LinkdingLoginView(auth_views.LoginView): def get_context_data(self, **kwargs): context = super().get_context_data(**kwargs) - context["allow_registration"] = settings.ALLOW_REGISTRATION context["enable_oidc"] = settings.LD_ENABLE_OIDC return context diff --git a/pyproject.toml b/pyproject.toml index 7ba101a..d5de9bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,6 @@ dependencies = [ "bleach>=6.3.0", "bleach-allowlist>=1.0.3", "django>=6.0", - "django-registration>=5.2.1", "djangorestframework>=3.16.1", "huey>=2.5.5", "markdown>=3.10", diff --git a/scripts/run-docker.sh b/scripts/run-docker.sh index 430a9b6..96d3a96 100755 --- a/scripts/run-docker.sh +++ b/scripts/run-docker.sh @@ -2,7 +2,7 @@ variant="${1:-default}" -docker build -f "docker/$variant.Dockerfile" -t sissbruecker/linkding:local . +docker build -f "docker/$variant.Dockerfile" --target linkding -t sissbruecker/linkding:local . docker rm -f linkding-local || true diff --git a/uv.lock b/uv.lock index ed4e217..fb5fd8f 100644 --- a/uv.lock +++ b/uv.lock @@ -161,15 +161,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, ] -[[package]] -name = "confusable-homoglyphs" -version = "3.3.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/0d/10/1358fca1ee2d97d4f2877df9ffbe6d124da666fef3b2f75e771a4c1afee6/confusable_homoglyphs-3.3.1.tar.gz", hash = "sha256:b995001c9b2e1b4cea0cf5f3840a7c79188a8cbbad053d693572bd8c1c1ec460", size = 325480, upload-time = "2024-01-30T10:10:27.47Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c5/6e/c0fcbb7d341a46cf4241a6aa9e6a737734f0657521fc1bcd074953fe4eea/confusable_homoglyphs-3.3.1-py2.py3-none-any.whl", hash = "sha256:84c92cb79dc7f55aa290d0762b2349abd8dee4c16fbe6f99eac978d394e2e6a1", size = 144755, upload-time = "2024-01-30T10:10:24.857Z" }, -] - [[package]] name = "coverage" version = "7.13.1" @@ -328,19 +319,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6d/72/685c978af45ad08257e2c69687a873eda6b6531c79b6e6091794c41c5ff6/django_debug_toolbar-6.1.0-py3-none-any.whl", hash = "sha256:e214dea4494087e7cebdcea84223819c5eb97f9de3110a3665ad673f0ba98413", size = 269069, upload-time = "2025-10-30T19:50:37.71Z" }, ] -[[package]] -name = "django-registration" -version = "5.2.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "confusable-homoglyphs" }, - { name = "django" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/9a/a0/f6e6d0a59b94eb4ab14983853334cb25401d677c5a3799aaca6819acf2eb/django_registration-5.2.1.tar.gz", hash = "sha256:06864f9da0bc4d7b073fb2da98d95d12428357ab0bc46e33f79c26707ec06bbe", size = 94187, upload-time = "2025-04-07T05:54:48.558Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/78/5d/aa2f82b3c809db66eb986963db1d4b89de190b4eac2e3021a725112e3b13/django_registration-5.2.1-py3-none-any.whl", hash = "sha256:7079e2364b15fc6bef18b81ae94c5e947b556abdbbfb19c9bcca14feafde6a3d", size = 105277, upload-time = "2025-04-07T05:54:46.981Z" }, -] - [[package]] name = "djangorestframework" version = "3.16.1" @@ -484,7 +462,6 @@ dependencies = [ { name = "bleach" }, { name = "bleach-allowlist" }, { name = "django" }, - { name = "django-registration" }, { name = "djangorestframework" }, { name = "huey" }, { name = "markdown" }, @@ -517,7 +494,6 @@ requires-dist = [ { name = "bleach", specifier = ">=6.3.0" }, { name = "bleach-allowlist", specifier = ">=1.0.3" }, { name = "django", specifier = ">=6.0" }, - { name = "django-registration", specifier = ">=5.2.1" }, { name = "djangorestframework", specifier = ">=3.16.1" }, { name = "huey", specifier = ">=2.5.5" }, { name = "markdown", specifier = ">=3.10" },