Skip to content

Commit 72d4f4e

Browse files
committed
fixes
1 parent 177de8c commit 72d4f4e

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

packages/postgres-database/src/simcore_postgres_database/utils_users.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,9 @@ async def is_email_used(
307307
if registered:
308308
return True
309309

310+
# Check if email exists in pre-registration, regardless of user_id status
310311
pre_registered = await conn.scalar(
311-
sa.select(users_pre_registration_details.c.user_id).where(
312+
sa.select(users_pre_registration_details.c.id).where(
312313
users_pre_registration_details.c.pre_email == email
313314
)
314315
)

packages/service-library/tests/aiohttp/test_rest_middlewares.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,13 +361,13 @@ async def test_exception_in_handler_returns_500(
361361
):
362362
"""Test that exceptions in the handler functions are caught and return 500."""
363363

364-
# Mock _handle_http_successful to raise an exception
364+
# Mock _handle_aiohttp_web_http_successful to raise an exception
365365
def mocked_handler(*args, **kwargs):
366366
msg = "Simulated error in handler"
367367
raise ValueError(msg)
368368

369369
mocker.patch(
370-
"servicelib.aiohttp.rest_middlewares._handle_http_successful",
370+
"servicelib.aiohttp.rest_middlewares._handle_aiohttp_web_http_successful",
371371
side_effect=mocked_handler,
372372
)
373373

services/web/server/src/simcore_service_webserver/login/_auth_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ async def check_authorized_user_credentials(
121121

122122
user = check_not_null_user(user)
123123

124-
_login_service.validate_user_status(
124+
_login_service.validate_user_access(
125125
user_status=user["status"],
126126
user_role=user["role"],
127127
support_email=product.support_email,

services/web/server/src/simcore_service_webserver/login/_controller/rest/change.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from ..._login_service import (
2323
ACTIVE,
2424
CHANGE_EMAIL,
25-
validate_user_status,
25+
validate_user_access,
2626
)
2727
from ...constants import (
2828
MSG_CANT_SEND_MAIL,
@@ -136,7 +136,7 @@ def _get_error_context(
136136

137137
# CHECK user state
138138
try:
139-
validate_user_status(
139+
validate_user_access(
140140
user_status=user["status"],
141141
user_role=user["role"],
142142
support_email=product.support_email,

services/web/server/src/simcore_service_webserver/login/_login_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def _to_names(enum_cls, names) -> list[str]:
3939
)
4040

4141

42-
def validate_user_status(*, user_status: str, user_role: str, support_email: str):
42+
def validate_user_access(*, user_status: str, user_role: str, support_email: str):
4343
"""
4444
4545
Raises:

0 commit comments

Comments
 (0)