auth_fc: set the created user in the registration mail template context (#72358)

This commit is contained in:
Benjamin Dauvergne 2022-12-13 16:40:58 +01:00
parent 210f6bdf01
commit 5dddd1c674
2 changed files with 2 additions and 1 deletions

View File

@ -498,6 +498,7 @@ class LoginOrLinkView(View):
user,
template_names=['authentic2_auth_fc/registration_success'],
context={
'user': user,
'login_url': request.build_absolute_uri(settings.LOGIN_URL),
},
request=self.request,

View File

@ -126,7 +126,7 @@ def test_create(settings, app, franceconnect, hooks, service, mailoutbox):
assert len(mailoutbox) == 1
assert mailoutbox[0].subject == 'Account creation using FranceConnect'
for body in (mailoutbox[0].body, mailoutbox[0].alternatives[0][0]):
assert 'Hi AnonymousUser,' in body
assert 'Hi john.doe@example.com,' in body
assert 'You have just created an account using FranceConnect.' in body
assert 'https://testserver/login/' in body