language models and set defaults are updated

This commit is contained in:
2025-01-28 17:38:23 +03:00
parent 5d3f946642
commit 8550c2af71
10 changed files with 115 additions and 72 deletions

View File

@@ -186,7 +186,9 @@ AuthenticationChangePasswordEventMethods.endpoint_callable = (
AuthenticationCreatePasswordEventMethods = MethodToEvent(
name="AuthenticationCreatePasswordEventMethods",
events={authentication_create_password_event.key: authentication_create_password_event},
events={
authentication_create_password_event.key: authentication_create_password_event
},
headers=[],
errors=[],
url="/create-password",

View File

@@ -231,7 +231,7 @@ class AuthenticationFunctions:
# Get token from login module
user_login_module = UserLoginModule(request=request)
user_login_module.login_user_via_credentials(access_data=data)
user_login_module.language = "tr"
user_login_module.language = "en"
# Return response with token and headers
return EndpointSuccessResponse(
@@ -244,23 +244,20 @@ class AuthenticationFunctions:
Handle selection of company or occupant type
{"data": {"build_living_space_uu_id": ""}} | {"data": {"company_uu_id": ""}}
"""
selection_dict = dict(
request=cls.context_retriever.request,
token_dict=cls.context_retriever.token,
data=data,
)
if cls.context_retriever.token.is_employee:
if Handlers.handle_employee_selection(
request=cls.context_retriever.request,
data=data,
token_dict=cls.context_retriever.token,
):
if Handlers.handle_employee_selection(**selection_dict):
return EndpointSuccessResponse(
code="LOGIN_SELECT", lang=cls.context_retriever.token.lang
).as_dict(
data={"selected": data.company_uu_id, **cls.context_retriever.base}
)
elif cls.context_retriever.token.is_occupant:
if Handlers.handle_occupant_selection(
request=cls.context_retriever.request,
data=data,
token_dict=cls.context_retriever.token,
):
if Handlers.handle_occupant_selection(**selection_dict):
return EndpointSuccessResponse(
code="LOGIN_SELECT", lang=cls.context_retriever.token.lang
).as_dict(