events updated

This commit is contained in:
2024-12-29 19:16:26 +03:00
parent 5223f36da7
commit 7997e561f7
12 changed files with 250 additions and 31 deletions

View File

@@ -270,7 +270,6 @@ class AuthenticationSelectEventMethods(MethodToEvent):
)
class AuthenticationCheckTokenEventMethods(MethodToEvent):
event_type = "LOGIN"
@@ -286,8 +285,8 @@ class AuthenticationCheckTokenEventMethods(MethodToEvent):
@classmethod
def authentication_check_token_is_valid(
cls,
request,
cls,
request,
):
if get_object_via_access_key(request=request):
return JSONResponse(
@@ -712,9 +711,9 @@ class AuthenticationDownloadAvatarEventMethods(MethodToEvent):
}
@classmethod
def authentication_download_avatar(cls, token_dict: Union[
EmployeeTokenObject, OccupantTokenObject
]):
def authentication_download_avatar(
cls, token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
):
if found_user := Users.filter_one(Users.id == token_dict.user_id).data:
expired_starts = str(
system_arrow.now() - system_arrow.get(str(found_user.expiry_ends))
@@ -728,6 +727,7 @@ class AuthenticationDownloadAvatarEventMethods(MethodToEvent):
"completed": True,
"message": "Avatar and profile is shared via user credentials",
"data": {
"lang": token_dict.lang,
"full_name": found_user.person.full_name,
"avatar": found_user.avatar,
"remember_me": found_user.remember_me,