auth_fc: provide clearer account linking errors (#68368)

This commit is contained in:
Paul Marillonnet 2022-09-15 08:02:32 +02:00
parent 1c4b9c6d4b
commit ca706fde6f
3 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@
<p>
<div id="fc-button-wrapper">
<div id="fc-button">
<div>{% trans "Link with a FranceConnect account" %}</div>
<div>{% trans "Link your user account to FranceConnect" %}</div>
<a href="{{ link_url }}" class="button linking-button connexion">
<span class="sr-only">{% trans "Link with a FranceConnect account" %}</span>
</a>

View File

@ -495,12 +495,12 @@ class LoginOrLinkView(View):
# currently logged :
if models.FcAccount.objects.filter(user=request.user, order=0).count():
# cannot link because we are already linked to another FC account
messages.error(request, _('Your account is already linked to a FranceConnect account'))
messages.error(request, _('Your account is already linked to FranceConnect'))
else:
# cannot link because the FC account is already linked to another account.
messages.error(
request,
_('The FranceConnect account {} is already linked with another account.').format(
_('The FranceConnect identity {} is already linked to another account.').format(
self.fc_display_name
),
)

View File

@ -414,7 +414,7 @@ def test_user_info_incomplete_already_linked(settings, app, franceconnect, simpl
if isinstance(cookie, list):
assert len(cookie) == 1
cookie = cookie[0].message
assert 'FranceConnect account is already' in cookie
assert 'FranceConnect identity is already' in cookie
def test_save_account_on_delete_user(db):