don't alter can_reset_password flag for users without an FC account (#25655)

This commit is contained in:
Frédéric Péters 2018-08-13 11:48:13 +02:00 committed by Thomas NOEL
parent 9b8e493ded
commit c21a16108a
1 changed files with 3 additions and 1 deletions

View File

@ -67,7 +67,9 @@ class AppConfig(django.apps.AppConfig):
serializer.fields['franceconnect'] = serializers.SerializerMethodField()
def a2_hook_user_can_reset_password(self, user):
return user.fc_accounts.exists()
if user.fc_accounts.exists():
return True
return None
default_app_config = '%s.%s' % (__name__, 'AppConfig')