alchemy functions updated
This commit is contained in:
@@ -112,7 +112,7 @@ class BuildingLivingSpacesPartsCreateEventMethods(MethodToEvent):
|
||||
detail=f"{data.build_parts_uu_id} - Build Part is not found in database. Check build part uu_id",
|
||||
)
|
||||
|
||||
life_person = People.filter_one(People.uu_id==data.person_uu_id or "").data
|
||||
life_person = People.filter_one(People.uu_id == data.person_uu_id or "").data
|
||||
if not life_person:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
@@ -145,7 +145,7 @@ class BuildingLivingSpacesPartsCreateEventMethods(MethodToEvent):
|
||||
str(system_arrow.now()) >= BuildLivingSpace.expiry_starts,
|
||||
select_args=[BuildLivingSpace.id],
|
||||
order_by=BuildLivingSpace.expiry_starts.desc(),
|
||||
limit=1
|
||||
limit=1,
|
||||
).data
|
||||
|
||||
last_living_space = BuildLivingSpace.filter_one(
|
||||
@@ -162,7 +162,9 @@ class BuildingLivingSpacesPartsCreateEventMethods(MethodToEvent):
|
||||
last_living_space.expiry_ends = str(system_arrow.shift(minutes=-10))
|
||||
last_living_space.save()
|
||||
|
||||
user_module = Modules.filter_one(Modules.module_code == "USR-PUB", system=True).data
|
||||
user_module = Modules.filter_one(
|
||||
Modules.module_code == "USR-PUB", system=True
|
||||
).data
|
||||
ModulesBindOccupantEventMethods.modules_bind_occupant_system(
|
||||
build_living_space_id=created_living_space.id,
|
||||
modules_id=user_module.id,
|
||||
@@ -198,7 +200,9 @@ class BuildingLivingSpacesPartsUpdateEventMethods(MethodToEvent):
|
||||
detail=f"{data.build_parts_uu_id} - Build Part is not found in database. Check build part uu_id",
|
||||
)
|
||||
|
||||
life_person = People.filter_one(People.uu_id==data.life_person_uu_id or "").data
|
||||
life_person = People.filter_one(
|
||||
People.uu_id == data.life_person_uu_id or ""
|
||||
).data
|
||||
if not life_person:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_418_IM_A_TEAPOT,
|
||||
@@ -209,7 +213,7 @@ class BuildingLivingSpacesPartsUpdateEventMethods(MethodToEvent):
|
||||
living_space_id = BuildLivingSpace.select_only(
|
||||
select_args=[BuildLivingSpace.id],
|
||||
order_by=BuildLivingSpace.expiry_starts.desc(),
|
||||
limit=1
|
||||
limit=1,
|
||||
).get(1)
|
||||
|
||||
last_living_space = BuildLivingSpace.filter_one(
|
||||
|
||||
Reference in New Issue
Block a user