Skip to content

Commit

Permalink
(PC-32501)[BO] fix: connect as when role are not properly synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
Meewan committed Oct 17, 2024
1 parent a82cd2a commit e0741f8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion api/src/pcapi/routes/backoffice/pro/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def get_user_id_for_connect_as_base_query() -> BaseQuery:
users_models.User.isActive.is_(True),
~users_models.User.has_admin_role, # type: ignore[operator] # pylint: disable=invalid-unary-operand-type
~users_models.User.has_anonymized_role, # type: ignore[operator] # pylint: disable=invalid-unary-operand-type
users_models.User.has_pro_role,
offerers_models.UserOfferer.isValidated,
)
)

Expand Down
6 changes: 0 additions & 6 deletions api/tests/routes/backoffice/pro_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,6 @@ def test_connect_as_venue_without_active_user(self, authenticated_client):
[users_models.UserRole.PRO, users_models.UserRole.ADMIN],
[users_models.UserRole.ADMIN],
[users_models.UserRole.PRO, users_models.UserRole.ANONYMIZED],
[],
],
)
def test_connect_as_venue_without_eligible_user(self, authenticated_client, roles):
Expand Down Expand Up @@ -1399,7 +1398,6 @@ def test_connect_as_offerer_without_active_user(self, authenticated_client):
[users_models.UserRole.PRO, users_models.UserRole.ADMIN],
[users_models.UserRole.ADMIN],
[users_models.UserRole.PRO, users_models.UserRole.ANONYMIZED],
[],
],
)
def test_connect_as_offerer_without_eligible_user(self, authenticated_client, roles):
Expand Down Expand Up @@ -1532,7 +1530,6 @@ def test_connect_as_offer_without_active_user(self, authenticated_client):
[users_models.UserRole.PRO, users_models.UserRole.ADMIN],
[users_models.UserRole.ADMIN],
[users_models.UserRole.PRO, users_models.UserRole.ANONYMIZED],
[],
],
)
def test_connect_as_offer_without_eligible_user(self, authenticated_client, roles):
Expand Down Expand Up @@ -1665,7 +1662,6 @@ def test_connect_as_bank_account_without_active_user(self, authenticated_client)
[users_models.UserRole.PRO, users_models.UserRole.ADMIN],
[users_models.UserRole.ADMIN],
[users_models.UserRole.PRO, users_models.UserRole.ANONYMIZED],
[],
],
)
def test_connect_as_bank_account_without_eligible_user(self, authenticated_client, roles):
Expand Down Expand Up @@ -1800,7 +1796,6 @@ def test_connect_as_collective_offer_without_active_user(self, authenticated_cli
[users_models.UserRole.PRO, users_models.UserRole.ADMIN],
[users_models.UserRole.ADMIN],
[users_models.UserRole.PRO, users_models.UserRole.ANONYMIZED],
[],
],
)
def test_connect_as_collective_offer_without_eligible_user(self, authenticated_client, roles):
Expand Down Expand Up @@ -1936,7 +1931,6 @@ def test_connect_as_collective_offer_template_without_active_user(self, authenti
[users_models.UserRole.PRO, users_models.UserRole.ADMIN],
[users_models.UserRole.ADMIN],
[users_models.UserRole.PRO, users_models.UserRole.ANONYMIZED],
[],
],
)
def test_connect_as_collective_offer_template_without_eligible_user(self, authenticated_client, roles):
Expand Down

0 comments on commit e0741f8

Please sign in to comment.