save and confirmed added
This commit is contained in:
@@ -214,7 +214,7 @@ class BuildPatchEventMethods(MethodToEvent):
|
||||
@classmethod
|
||||
def build_patch(cls, build_uu_id: str, data: PatchRecord, token_dict):
|
||||
find_one_build = Build.filter_one(
|
||||
Build.uu_id==build_uu_id,
|
||||
Build.uu_id == build_uu_id,
|
||||
)
|
||||
access_authorized_build = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id,
|
||||
|
||||
@@ -75,7 +75,9 @@ class BuildAreaCreateEventMethods(MethodToEvent):
|
||||
"build_uu_id": data.build_uu_id,
|
||||
},
|
||||
)
|
||||
selected_build = Build.filter_by_one(system=True, uu_id=data.build_uu_id).data
|
||||
selected_build = Build.filter_by_one(
|
||||
system=True, uu_id=data.build_uu_id
|
||||
).data
|
||||
elif isinstance(token_dict, EmployeeTokenObject):
|
||||
build_ids = Build.select_action(
|
||||
employee_id=token_dict.selected_company.employee_id
|
||||
@@ -89,7 +91,9 @@ class BuildAreaCreateEventMethods(MethodToEvent):
|
||||
"build_uu_id": data.build_uu_id,
|
||||
},
|
||||
)
|
||||
selected_build = Build.filter_by_one(system=True, uu_id=data.build_uu_id).data
|
||||
selected_build = Build.filter_by_one(
|
||||
system=True, uu_id=data.build_uu_id
|
||||
).data
|
||||
|
||||
data_dict["build_id"] = selected_build.id
|
||||
data_dict["build_uu_id"] = str(selected_build.uu_id)
|
||||
|
||||
@@ -18,11 +18,12 @@ class BuildTypesListEventMethods(MethodToEvent):
|
||||
|
||||
@classmethod
|
||||
def build_types_list(
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject]
|
||||
cls,
|
||||
list_options: ListOptions,
|
||||
token_dict: Union[EmployeeTokenObject, OccupantTokenObject],
|
||||
):
|
||||
from fastapi.exceptions import HTTPException
|
||||
|
||||
if isinstance(token_dict, EmployeeTokenObject):
|
||||
BuildTypes.filter_attr = list_options
|
||||
results = BuildTypes.filter_all()
|
||||
@@ -33,15 +34,14 @@ class BuildTypesListEventMethods(MethodToEvent):
|
||||
)
|
||||
elif isinstance(token_dict, OccupantTokenObject):
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="You are not authorized to access this endpoint"
|
||||
status_code=403, detail="You are not authorized to access this endpoint"
|
||||
)
|
||||
else:
|
||||
raise HTTPException(
|
||||
status_code=403,
|
||||
detail="You are not authorized to access this endpoint"
|
||||
status_code=403, detail="You are not authorized to access this endpoint"
|
||||
)
|
||||
|
||||
|
||||
BuildTypesListEventMethod = BuildTypesListEventMethods(
|
||||
action=ActionsSchema(endpoint="/building/types/list")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -180,9 +180,11 @@ class BuildingLivingSpacesPartsCreateEventMethods(MethodToEvent):
|
||||
dt = system_arrow.get(last_living_space.expiry_ends)
|
||||
if dt > system_arrow.now():
|
||||
minute_df = int(dt.time().minute) - 10
|
||||
last_living_space.expiry_ends = str(dt.replace(
|
||||
minute=60 - abs(minute_df) if minute_df < 0 else minute_df
|
||||
))
|
||||
last_living_space.expiry_ends = str(
|
||||
dt.replace(
|
||||
minute=60 - abs(minute_df) if minute_df < 0 else minute_df
|
||||
)
|
||||
)
|
||||
last_living_space.save()
|
||||
|
||||
user_module = Modules.filter_one(
|
||||
|
||||
Reference in New Issue
Block a user