diff --git a/account_manager/models.py b/account_manager/models.py index 68eeb26..72e82c1 100644 --- a/account_manager/models.py +++ b/account_manager/models.py @@ -11,6 +11,7 @@ from core.tokens import account_activation_token from django.core.mail import EmailMessage from django.contrib.auth.models import User from django.contrib.auth.tokens import default_token_generator +from core.settings import PASSWORD_RESET_TIMEOUT_DAYS import re @@ -53,7 +54,8 @@ class LdapUser(Model): 'uid': urlsafe_base64_encode(force_bytes(user.pk)).decode(), 'token': default_token_generator.make_token(user=user), 'protocol': protocol, - 'email': email + 'email': email, + 'expiration_days': PASSWORD_RESET_TIMEOUT_DAYS }) email = EmailMessage( mail_subject, message, to=[user.email] diff --git a/templates/registration/welcome_email.jinja2 b/templates/registration/welcome_email.jinja2 index b6f79f5..ac866a1 100644 --- a/templates/registration/welcome_email.jinja2 +++ b/templates/registration/welcome_email.jinja2 @@ -5,4 +5,5 @@
Um deinen Account zu aktivieren
Über den folgenden Link kannst du deinen Account aktivieren: {{ protocol }}://{{ domain }}{{ url('ldap_password_reset_confirm', kwargs={'uidb64':uid, 'token':token}) }}
+Der Link ist nur {{ expiration_days }} Tage gültig!