Skip to content

Commit

Permalink
fixing test
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Dec 13, 2024
1 parent 1503da4 commit 5e993f7
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from ..users.api import (
delete_user_without_projects,
get_guest_user_ids_and_names,
get_user,
get_user_primary_group_id,
get_user_role,
)
Expand Down Expand Up @@ -49,16 +48,13 @@ async def _delete_all_projects_for_user(app: web.Application, user_id: int) -> N
project_owner_primary_gid = await get_user_primary_group_id(
app=app, user_id=user_id
)
project_owner: dict = await get_user(app=app, user_id=user_id)
except exceptions.UserNotFoundError:
_logger.warning(
"Could not recover user data for user '%s', stopping removal of projects!",
f"{user_id=}",
)
return

user_primary_gid = int(project_owner["primary_gid"])

# fetch all projects for the user
user_project_uuids = await ProjectDBAPI.get_from_app_context(
app
Expand All @@ -67,7 +63,7 @@ async def _delete_all_projects_for_user(app: web.Application, user_id: int) -> N
_logger.info(
"Removing or transfering projects of user with %s, %s: %s",
f"{user_id=}",
f"{project_owner=}",
f"{project_owner_primary_gid=}",
f"{user_project_uuids=}",
)

Expand Down Expand Up @@ -95,7 +91,7 @@ async def _delete_all_projects_for_user(app: web.Application, user_id: int) -> N
app=app,
project_uuid=project_uuid,
user_id=user_id,
user_primary_gid=user_primary_gid,
user_primary_gid=project_owner_primary_gid,
project=project,
)

Expand Down Expand Up @@ -134,7 +130,7 @@ async def _delete_all_projects_for_user(app: web.Application, user_id: int) -> N
await replace_current_owner(
app=app,
project_uuid=project_uuid,
user_primary_gid=user_primary_gid,
user_primary_gid=project_owner_primary_gid,
new_project_owner_gid=new_project_owner_gid,
project=project,
)
Expand Down

0 comments on commit 5e993f7

Please sign in to comment.