From c4976c4b34a48669b8c7cd7d5ea773d7886f772e Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 14 Nov 2024 21:54:17 +0100 Subject: [PATCH] feat: Upgrade django-registration to 5.1 --- pyproject.toml | 2 +- .../django_registration/activation_email_body.txt | 8 +++++--- .../django_registration/activation_form.html | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 src/templates/django_registration/activation_form.html diff --git a/pyproject.toml b/pyproject.toml index 2e0b0a6..36b59b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dependencies = [ "model_bakery", "markdown", "Pillow", - "django-registration<=3.4", + "django-registration", "psycopg2-binary", "django-crispy-forms", "crispy-bootstrap4", diff --git a/src/templates/django_registration/activation_email_body.txt b/src/templates/django_registration/activation_email_body.txt index c36520e..22d1aa9 100644 --- a/src/templates/django_registration/activation_email_body.txt +++ b/src/templates/django_registration/activation_email_body.txt @@ -1,8 +1,10 @@ {% load i18n %} {{ site.name }}: {% trans "Account aktivieren" %} +{% trans 'Hier ist dein Aktivierungs-Key. Mit diesem kannst du deinen Account freischalten.' %} +{{ activation_key }} -{% trans "Öffne den folgenden link im Browser um deinen Account zu aktivieren" %}: -https://{{ site.domain }}{% url 'django_registration_activate' activation_key%} +{% trans "Öffne den folgenden link im Browser und gib den Aktivierungs-Key dort ein" %}: +https://{{ site.domain }}{% url 'django_registration_activate' %} -{% blocktrans %}Der link ist gültig für {{ expiration_days }} tage.{% endblocktrans %} \ No newline at end of file +{% blocktrans %}Der Link ist für {{ expiration_days }} Tage gültig.{% endblocktrans %} \ No newline at end of file diff --git a/src/templates/django_registration/activation_form.html b/src/templates/django_registration/activation_form.html new file mode 100644 index 0000000..565563b --- /dev/null +++ b/src/templates/django_registration/activation_form.html @@ -0,0 +1,15 @@ +{% extends "fellchensammlung/base_generic.html" %} +{% load i18n %} +{% load crispy_forms_tags %} + +{% block content %} + {% if not user.is_authenticated %} +
+ {% csrf_token %} + {{ form.as_p }} + +
+ {% else %} +

{% translate "Du bist bereits eingeloggt." %}

+ {% endif %} +{% endblock %} \ No newline at end of file