services are checked
This commit is contained in:
@@ -59,7 +59,9 @@ class PeopleCreateEventMethods(MethodToEvent):
|
||||
|
||||
@classmethod
|
||||
def people_create(
|
||||
cls, data: InsertPerson, token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
data: InsertPerson,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
created_user = People.create_action(data=data, token=token_dict)
|
||||
People.save()
|
||||
@@ -82,7 +84,10 @@ class PeopleUpdateEventMethods(MethodToEvent):
|
||||
|
||||
@classmethod
|
||||
def people_update(
|
||||
cls, data: UpdateUsers, user_uu_id: str, token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
data: UpdateUsers,
|
||||
user_uu_id: str,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
find_one_user = Users.find_one_or_abort(uu_id=user_uu_id)
|
||||
access_authorized_company = Companies.select_action(
|
||||
|
||||
@@ -15,7 +15,8 @@ from api_validations.validations_request import (
|
||||
InsertUsers,
|
||||
UpdateUsers,
|
||||
PatchRecord,
|
||||
ListOptions, RegisterServices2Occupant,
|
||||
ListOptions,
|
||||
RegisterServices2Occupant,
|
||||
)
|
||||
|
||||
|
||||
@@ -61,7 +62,9 @@ class UserCreateEventMethods(MethodToEvent):
|
||||
|
||||
@classmethod
|
||||
def user_create(
|
||||
cls, data: InsertUsers, token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
data: InsertUsers,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
created_user = Users.create_action(create_user=data)
|
||||
created_user.related_company = token_dict.selected_company.company_uu_id
|
||||
@@ -99,7 +102,10 @@ class UserUpdateEventMethods(MethodToEvent):
|
||||
|
||||
@classmethod
|
||||
def user_update(
|
||||
cls, data: UpdateUsers, user_uu_id: str, token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
data: UpdateUsers,
|
||||
user_uu_id: str,
|
||||
token_dict: typing.Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
find_one_user = Users.find_one_or_abort(uu_id=user_uu_id)
|
||||
access_authorized_company = Companies.select_action(
|
||||
|
||||
Reference in New Issue
Block a user