Skip to content

Commit

Permalink
fixup! add is_proconnect method on User model
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jan 15, 2025
1 parent fe2eaa2 commit 5bb8f99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lacommunaute/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion lacommunaute/users/tests/tests_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5bb8f99

Please sign in to comment.