Remove registration switch (#1268)

This commit is contained in:
Sascha Ißbrücker
2026-01-05 05:52:43 +01:00
committed by GitHub
parent 65f3759444
commit 50180c9684
10 changed files with 1 additions and 98 deletions

View File

@@ -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,

View File

@@ -1,3 +1 @@
# Placeholder, can be mounted in a Docker container with a custom settings
# ALLOW_REGISTRATION = True

View File

@@ -1,12 +0,0 @@
{% extends 'shared/layout.html' %}
{% block head %}
{% with page_title="Registration complete - Linkding" %}{{ block.super }}{% endwith %}
{% endblock %}
{% block content %}
<main class="mx-auto width-50 width-md-100" aria-labelledby="main-heading">
<div class="section-header">
<h1 id="main-heading">Registration complete</h1>
</div>
<p class="text-success">You can now use the application.</p>
</main>
{% endblock %}

View File

@@ -1,39 +0,0 @@
{% extends 'shared/layout.html' %}
{% block head %}
{% with page_title="Registration - Linkding" %}{{ block.super }}{% endwith %}
{% endblock %}
{% block content %}
<main class="mx-auto width-50 width-md-100" aria-labelledby="main-heading">
<div class="section-header">
<h1 id="main-heading">Register</h1>
</div>
<form method="post"
action="{% url 'django_registration_register' %}"
novalidate>
{% csrf_token %}
<div class="form-group {% if form.errors.username %}has-error{% endif %}">
<label class="form-label" for="{{ form.username.id_for_label }}">Username</label>
{{ form.username }}
<div class="form-input-hint">{{ form.errors.username }}</div>
</div>
<div class="form-group {% if form.errors.email %}has-error{% endif %}">
<label class="form-label" for="{{ form.email.id_for_label }}">Email</label>
{{ form.email }}
<div class="form-input-hint">{{ form.errors.email }}</div>
</div>
<div class="form-group {% if form.errors.password1 %}has-error{% endif %}">
<label class="form-label" for="{{ form.password1.id_for_label }}">Password</label>
{{ form.password1 }}
<div class="form-input-hint">{{ form.errors.password1 }}</div>
</div>
<div class="form-group {% if form.errors.password2 %}has-error{% endif %}">
<label class="form-label" for="{{ form.password2.id_for_label }}">Confirm Password</label>
{{ form.password2 }}
<div class="form-input-hint">{{ form.errors.password2 }}</div>
</div>
<br />
<input type="submit" value="Register" class="btn btn-primary btn-wide">
<input type="hidden" name="next" value="{{ next }}">
</form>
</main>
{% endblock %}

View File

@@ -30,9 +30,6 @@
href="{% url 'oidc_authentication_init' %}"
data-turbo="false">Login with OIDC</a>
{% endif %}
{% if allow_registration %}
<a href="{% url 'django_registration_register' %}" class="btn btn-link">Register</a>
{% endif %}
</div>
</form>
</main>

View File

@@ -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))]

View File

@@ -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