Skip to content

Commit 4290e7e

Browse files
committed
users changes
1 parent 475eef7 commit 4290e7e

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ async def search_users_for_admin(request: web.Request) -> web.Response:
172172
UsersForAdminSearchQueryParams, request
173173
)
174174

175-
found = await _users_service.search_users(
175+
found = await _users_service.search_users_as_admin(
176176
request.app, email_glob=query_params.email, include_products=True
177177
)
178178

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async def pre_register_user(
4545
creator_user_id: UserID,
4646
) -> UserForAdminGet:
4747

48-
found = await search_users(app, email_glob=profile.email, include_products=False)
48+
found = await search_users_as_admin(
49+
app, email_glob=profile.email, include_products=False
50+
)
4951
if found:
5052
raise AlreadyPreRegisteredError(num_found=len(found), email=profile.email)
5153

@@ -76,7 +78,9 @@ async def pre_register_user(
7678
**details,
7779
)
7880

79-
found = await search_users(app, email_glob=profile.email, include_products=False)
81+
found = await search_users_as_admin(
82+
app, email_glob=profile.email, include_products=False
83+
)
8084

8185
assert len(found) == 1 # nosec
8286
return found[0]
@@ -125,7 +129,7 @@ async def get_user_id_from_gid(app: web.Application, primary_gid: GroupID) -> Us
125129
return await _users_repository.get_user_id_from_pgid(app, primary_gid=primary_gid)
126130

127131

128-
async def search_users(
132+
async def search_users_as_admin(
129133
app: web.Application, email_glob: str, *, include_products: bool = False
130134
) -> list[UserForAdminGet]:
131135
# NOTE: this search is deploy-wide i.e. independent of the product!

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
get_user_role,
1616
get_users_in_group,
1717
is_user_in_product,
18+
search_public_users,
1819
set_user_as_deleted,
1920
update_expired_users,
2021
)
@@ -36,6 +37,7 @@
3637
"get_users_in_group",
3738
"is_user_in_product",
3839
"set_user_as_deleted",
40+
"search_public_users",
3941
"update_expired_users",
4042
)
4143
# nopycln: file

0 commit comments

Comments
 (0)