1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-20 17:41:55 +02:00

Update mail translation

This commit is contained in:
Yohann D'ANELLO
2020-04-09 22:03:26 +02:00
parent e067b19d41
commit fc511689b0
7 changed files with 228 additions and 146 deletions

View File

@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-3.0-or-later
import datetime
import os
from django.conf import settings
from django.contrib.auth.models import User
@ -79,12 +80,10 @@ class Profile(models.Model):
def send_email_validation_link(self):
subject = "Activate your Note Kfet account"
message = loader.render_to_string('registration/email_validation_email.html',
message = loader.render_to_string('registration/mails/email_validation_email.html',
{
'user': self.user,
'domain': "nk20.ynerant.fr",
'site_name': "La Note Kfet",
'protocol': 'https',
'domain': os.getenv("NOTE_URL", "note.example.com"),
'token': email_validation_token.make_token(self.user),
'uid': urlsafe_base64_encode(force_bytes(self.user.pk)).decode('UTF-8'),
})

View File

@ -112,6 +112,7 @@ class UserValidateView(TemplateView):
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['user'] = self.get_user(self.kwargs["uidb64"])
context['login_url'] = resolve_url(settings.LOGIN_URL)
if self.validlink:
context['validlink'] = True