Skip to content

Commit

Permalink
@sanderegg review: await
Browse files Browse the repository at this point in the history
  • Loading branch information
pcrespov committed Dec 13, 2024
1 parent 6f077d3 commit a9b48dc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ async def remove_guest_user_with_all_its_resources(
ProjectNotFoundError,
UserNotFoundError,
ProjectDeleteError,
Exception,
) as error:
_logger.warning(
"Failed to delete guest user %s and its resources: %s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async def get_user_products(
return [row async for row in result]


async def new_user_details(
async def create_user_details(
engine: AsyncEngine,
connection: AsyncConnection | None = None,
*,
Expand All @@ -340,8 +340,8 @@ async def get_user_billing_details(
"""
async with pass_or_acquire_connection(engine, connection) as conn:
query = UsersRepo.get_billing_details_query(user_id=user_id)
result = await conn.stream(query)
row = await result.fetchone()
result = await conn.execute(query)
row = result.fetchone()
if not row:
raise BillingDetailsNotFoundError(user_id=user_id)
return UserBillingDetails.model_validate(row)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def pre_register_user(
if key in details:
details[f"pre_{key}"] = details.pop(key)

await _users_repository.new_user_details(
await _users_repository.create_user_details(
get_asyncpg_engine(app),
email=profile.email,
created_by=creator_user_id,
Expand Down

0 comments on commit a9b48dc

Please sign in to comment.