diff --git a/lacommunaute/users/models.py b/lacommunaute/users/models.py index 73f061c5..b9a1b9e8 100644 --- a/lacommunaute/users/models.py +++ b/lacommunaute/users/models.py @@ -26,5 +26,6 @@ class User(AbstractUser): def __str__(self): return self.email + @property def is_proconnect(self): return self.identity_provider == IdentityProvider.PRO_CONNECT diff --git a/lacommunaute/users/tests/tests_models.py b/lacommunaute/users/tests/tests_models.py index 3bfab157..ee724a33 100644 --- a/lacommunaute/users/tests/tests_models.py +++ b/lacommunaute/users/tests/tests_models.py @@ -19,4 +19,4 @@ def test_create_user_without_username(db): ) def test_is_proconnect(identity_provider, is_proconnect): user = User(identity_provider=identity_provider) - assert user.is_proconnect() == is_proconnect + assert user.is_proconnect == is_proconnect