Skip to content

Commit c87109a

Browse files
committed
@sanderegg review: avoid cast
1 parent 8092f45 commit c87109a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

services/web/server/src/simcore_service_webserver/users/_users_repository.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,17 @@ async def is_user_in_product_name(
475475
users.join(
476476
user_to_groups,
477477
user_to_groups.c.uid == users.c.id,
478-
).join(products, products.c.group_id == user_to_groups.c.gid)
478+
).join(
479+
products,
480+
products.c.group_id == user_to_groups.c.gid,
481+
)
479482
)
480483
.where((users.c.id == user_id) & (products.c.name == product_name))
481484
)
482485
async with pass_or_acquire_connection(engine, connection) as conn:
483-
got_user_id: UserID | None = await conn.scalar(query)
484-
return got_user_id == user_id
486+
value = await conn.scalar(query)
487+
assert value is None or value == user_id # nosec
488+
return value is not None
485489

486490

487491
#

0 commit comments

Comments
 (0)