auth endpoints added
This commit is contained in:
@@ -244,7 +244,7 @@ class Build(CrudCollection):
|
||||
livable_parts = BuildParts.filter_all(
|
||||
BuildParts.build_id == self.id,
|
||||
BuildParts.human_livable == True,
|
||||
db=db_session
|
||||
db=db_session,
|
||||
)
|
||||
if not livable_parts.data:
|
||||
raise HTTPException(
|
||||
@@ -260,8 +260,7 @@ class Build(CrudCollection):
|
||||
for part in self.parts:
|
||||
building_types = {}
|
||||
build_type = BuildTypes.filter_by_one(
|
||||
system=True, id=part.build_part_type_id,
|
||||
db=db_session
|
||||
system=True, id=part.build_part_type_id, db=db_session
|
||||
).data
|
||||
if build_type.type_code in building_types:
|
||||
building_types[build_type.type_code]["list"].append(part.part_no)
|
||||
@@ -354,7 +353,9 @@ class BuildParts(CrudCollection):
|
||||
if build_type := BuildTypes.filter_by_one(
|
||||
system=True, id=self.part_type_id, db=db_session
|
||||
).data:
|
||||
return f"{str(build_type.type_name).upper()} : {str(self.part_no).upper()}"
|
||||
return (
|
||||
f"{str(build_type.type_name).upper()} : {str(self.part_no).upper()}"
|
||||
)
|
||||
return f"Undefined:{str(build_type.type_name).upper()}"
|
||||
|
||||
|
||||
@@ -430,7 +431,7 @@ class BuildLivingSpace(CrudCollection):
|
||||
),
|
||||
cls.start_date < formatted_date - timedelta(days=add_days),
|
||||
cls.stop_date > formatted_date + timedelta(days=add_days),
|
||||
db=db_session
|
||||
db=db_session,
|
||||
)
|
||||
return living_spaces.data, living_spaces.count
|
||||
|
||||
@@ -625,4 +626,3 @@ class BuildPersonProviding(CrudCollection):
|
||||
),
|
||||
{"comment": "People providing services for building"},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user