Projet

Général

Profil

Bug #52929

AttributeError: 'NoneType' object has no attribute 'fc_accounts'

Ajouté par Sentry Io il y a presque 3 ans. Mis à jour il y a presque 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
10 avril 2021
Echéance:
% réalisé:

0%

Temps estimé:
Hors marché:
Non
Patch proposed:
Oui
Planning:
Non

Description

https://sentry.entrouvert.org/entrouvert/publik/issues/42926/

AttributeError: 'NoneType' object has no attribute 'fc_accounts'
(2 additional frame(s) were not displayed)
...
  File "django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "authentic2_auth_fc/views.py", line 332, in dispatch
    return super(FcOAuthSessionViewMixin, self).dispatch(request, *args, **kwargs)
  File "django/views/generic/base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "authentic2_auth_fc/views.py", line 432, in get
    if not user.fc_accounts.filter(sub=self.sub).exists():

Fichiers


Demandes liées

Lié à Plugin FS FranceConnect - Development #49797: crash quand un compte FC n'a pas d'infos associéeFermé01 janvier 2021

Actions

Révisions associées

Révision afc6ecd8 (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

crypto: remove py2 compatibility code (#52929)

Révision 03a874be (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

crypto: add utility for create hash chains (#52929)

Révision c514c679 (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

utils: add a safe_get_or_create() primitive (#52929)

Révision 316248cf (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

compat: add a set_cookie function (#52929)

Révision 5aff1a38 (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

utils: pass given service to journal in login (#52929)

Révision 035c603f (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

auth_fc: separate link from login use case (#52929)

Révision a208a481 (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

auth_fc: ensure token and user_info are never empty (#52929)

Révision 87677f6d (diff)
Ajouté par Benjamin Dauvergne il y a presque 3 ans

auth_fc: completely move account creation into the view (#52929)

- removed unused popup mode
- removed unused cache customization
- removed unused app_settings
- removed obsolete FranceConnect data provider support
- added tests cases to augment coverage on error cases
- removed storage of fc_user_info in session
- removed old attribute mapping
- only save id_token in session on login

Historique

#1

Mis à jour par Frédéric Péters il y a presque 3 ans

  • Projet changé de Suivi des traces à Plugin FS FranceConnect
  • Hors marché mis à Non
#2

Mis à jour par Benjamin Dauvergne il y a presque 3 ans

  • Assigné à mis à Benjamin Dauvergne
#3

Mis à jour par Benjamin Dauvergne il y a presque 3 ans

#4

Mis à jour par Serghei Mihai il y a presque 3 ans

Vu le contexte des traces, le bug semble venir du fait qu'il y a déjà plusieurs compte avec l'adresse mail transmise par FC, et donc dans authenticate:

            if user_qs.count() > 1:
                return

provoque le bug dans la vue.

#5

Mis à jour par Serghei Mihai il y a presque 3 ans

Test qui permet de réproduire.

#6

Mis à jour par Benjamin Dauvergne il y a presque 3 ans

https://jenkins.entrouvert.org/job/authentic-wip/job/wip%252F52929-AttributeError-NoneType-object-h/

https://git.entrouvert.org/authentic.git/log/?h=wip/52929-AttributeError-NoneType-object-h

J'essaye d'augmenter la couverture du code (on avait pas de tests sur le simple fait de linker son compte depuis /accounts/) mais le code est déjà ok pour moi.

#7

Mis à jour par Serghei Mihai il y a presque 3 ans

  • Statut changé de Solution proposée à Solution validée

C'est ok pour moi aussi.

#8

Mis à jour par Benjamin Dauvergne il y a presque 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 87677f6d7e4f3296644ba0d4a82f29bf2ba1cf48
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Sun Apr 11 17:19:39 2021 +0200

    auth_fc: completely move account creation into the view (#52929)

    - removed unused popup mode
    - removed unused cache customization
    - removed unused app_settings
    - removed obsolete FranceConnect data provider support
    - added tests cases to augment coverage on error cases
    - removed storage of fc_user_info in session
    - removed old attribute mapping
    - only save id_token in session on login

commit a208a481cfbf14ee3900e05ca319123b2107e5a5
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Mon Apr 12 16:39:59 2021 +0200

    auth_fc: ensure token and user_info are never empty (#52929)

commit 035c603f3d630ccd98d9e454cc8bc185e95e66f7
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Sun Apr 11 16:42:35 2021 +0200

    auth_fc: separate link from login use case (#52929)

commit 5aff1a38bed1959f868087ce0eb3121af13b10dd
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Mon Apr 19 10:28:36 2021 +0200

    utils: pass given service to journal in login (#52929)

commit 316248cf961bd9f8c59f4c17d41d153ea2b511ea
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 16 10:06:46 2021 +0200

    compat: add a set_cookie function (#52929)

commit c514c6792777c95102b0a871c816987ceb24cc1b
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Sat Apr 17 17:53:44 2021 +0200

    utils: add a safe_get_or_create() primitive (#52929)

commit 03a874be582d2c8765482f2a8d07c0cba0475efe
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 16 02:53:11 2021 +0200

    crypto: add utility for create hash chains (#52929)

commit afc6ecd8ebc65d548173ca084825f6a0017e0332
Author: Benjamin Dauvergne <bdauvergne@entrouvert.com>
Date:   Fri Apr 16 01:22:17 2021 +0200

    crypto: remove py2 compatibility code (#52929)
#9

Mis à jour par Serghei Mihai il y a presque 3 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF