Projet

Général

Profil

0001-auth_fc-provide-clearer-account-linking-errors-68368.patch

Paul Marillonnet, 15 septembre 2022 08:02

Télécharger (2,84 ko)

Voir les différences:

Subject: [PATCH] auth_fc: provide clearer account linking errors (#68368)

 .../templates/authentic2_auth_fc/linking.html                 | 2 +-
 src/authentic2_auth_fc/views.py                               | 4 ++--
 tests/auth_fc/test_auth_fc.py                                 | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
src/authentic2_auth_fc/templates/authentic2_auth_fc/linking.html
15 15
        <p>
16 16
          <div id="fc-button-wrapper">
17 17
              <div id="fc-button">
18
                <div>{% trans "Link with a FranceConnect account" %}</div>
18
                <div>{% trans "Link your user account to FranceConnect" %}</div>
19 19
                <a href="{{ link_url }}" class="button linking-button connexion">
20 20
                  <span class="sr-only">{% trans "Link with a FranceConnect account" %}</span>
21 21
                </a>
src/authentic2_auth_fc/views.py
495 495
        # currently logged :
496 496
        if models.FcAccount.objects.filter(user=request.user, order=0).count():
497 497
            # cannot link because we are already linked to another FC account
498
            messages.error(request, _('Your account is already linked to a FranceConnect account'))
498
            messages.error(request, _('Your account is already linked to FranceConnect'))
499 499
        else:
500 500
            # cannot link because the FC account is already linked to another account.
501 501
            messages.error(
502 502
                request,
503
                _('The FranceConnect account {} is already linked with another account.').format(
503
                _('The FranceConnect identity {} is already linked to another account.').format(
504 504
                    self.fc_display_name
505 505
                ),
506 506
            )
tests/auth_fc/test_auth_fc.py
414 414
    if isinstance(cookie, list):
415 415
        assert len(cookie) == 1
416 416
        cookie = cookie[0].message
417
    assert 'FranceConnect account  is already' in cookie
417
    assert 'FranceConnect identity  is already' in cookie
418 418

  
419 419

  
420 420
def test_save_account_on_delete_user(db):
421
-