Project

General

Profile

Bug #52929

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

Added by Sentry Io about 3 years ago. Updated about 3 years ago.

Status:
Fermé
Priority:
Normal
Target version:
-
Start date:
10 April 2021
Due date:
% Done:

0%

Estimated time:
Hors marché:
No
Patch proposed:
Yes
Planning:
No

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():

Files


Related issues

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

Actions

Associated revisions

Revision afc6ecd8 (diff)
Added by Benjamin Dauvergne about 3 years ago

crypto: remove py2 compatibility code (#52929)

Revision 03a874be (diff)
Added by Benjamin Dauvergne about 3 years ago

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

Revision c514c679 (diff)
Added by Benjamin Dauvergne about 3 years ago

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

Revision 316248cf (diff)
Added by Benjamin Dauvergne about 3 years ago

compat: add a set_cookie function (#52929)

Revision 5aff1a38 (diff)
Added by Benjamin Dauvergne about 3 years ago

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

Revision 035c603f (diff)
Added by Benjamin Dauvergne about 3 years ago

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

Revision a208a481 (diff)
Added by Benjamin Dauvergne about 3 years ago

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

Revision 87677f6d (diff)
Added by Benjamin Dauvergne about 3 years ago

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

History

#1

Updated by Frédéric Péters about 3 years ago

  • Project changed from Suivi des traces to Plugin FS FranceConnect
  • Hors marché set to No
#2

Updated by Benjamin Dauvergne about 3 years ago

  • Assignee set to Benjamin Dauvergne
#3

Updated by Benjamin Dauvergne about 3 years ago

#4

Updated by Serghei Mihai about 3 years ago

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

Updated by Serghei Mihai about 3 years ago

Test qui permet de réproduire.

#6

Updated by Benjamin Dauvergne about 3 years ago

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

Updated by Serghei Mihai about 3 years ago

  • Status changed from Solution proposée to Solution validée

C'est ok pour moi aussi.

#8

Updated by Benjamin Dauvergne about 3 years ago

  • Status changed from Solution validée to 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

Updated by Serghei Mihai about 3 years ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF