Skip to content

Commit 9903c16

Browse files
committed
minor
1 parent 0d55bfe commit 9903c16

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
from models_library.rest_error import LogMessageType
88
from models_library.users import UserID
99
from pydantic import PositiveInt
10-
from servicelib.aiohttp import observer
11-
from servicelib.aiohttp.status import HTTP_200_OK
12-
from servicelib.mimetype_constants import MIMETYPE_APPLICATION_JSON
10+
from servicelib.aiohttp import observer, status
1311
from simcore_postgres_database.models.users import UserRole
1412

1513
from ..db.models import ConfirmationAction, UserStatus
@@ -57,25 +55,21 @@ def validate_user_status(*, user: dict, support_email: str):
5755
if user_status == DELETED:
5856
raise web.HTTPUnauthorized(
5957
text=MSG_USER_DELETED.format(support_email=support_email),
60-
content_type=MIMETYPE_APPLICATION_JSON,
6158
) # 401
6259

6360
if user_status == BANNED or user["role"] == ANONYMOUS:
6461
raise web.HTTPUnauthorized(
6562
text=MSG_USER_BANNED.format(support_email=support_email),
66-
content_type=MIMETYPE_APPLICATION_JSON,
6763
) # 401
6864

6965
if user_status == EXPIRED:
7066
raise web.HTTPUnauthorized(
7167
text=MSG_USER_EXPIRED.format(support_email=support_email),
72-
content_type=MIMETYPE_APPLICATION_JSON,
7368
) # 401
7469

7570
if user_status == CONFIRMATION_PENDING:
7671
raise web.HTTPUnauthorized(
7772
text=MSG_ACTIVATION_REQUIRED,
78-
content_type=MIMETYPE_APPLICATION_JSON,
7973
) # 401
8074

8175
assert user_status == ACTIVE # nosec
@@ -117,15 +111,15 @@ async def notify_user_logout(
117111

118112

119113
def flash_response(
120-
message: str, level: str = "INFO", *, status: int = HTTP_200_OK
114+
message: str, level: str = "INFO", *, status: int = status.HTTP_200_OK
121115
) -> web.Response:
122116
return envelope_response(
123117
data=asdict(LogMessageType(message, level)),
124118
status=status,
125119
)
126120

127121

128-
def envelope_response(data: Any, *, status: int = HTTP_200_OK) -> web.Response:
122+
def envelope_response(data: Any, *, status: int = status.HTTP_200_OK) -> web.Response:
129123
return web.json_response(
130124
{
131125
"data": data,

0 commit comments

Comments
 (0)