restructure wip - added is in conservation area to fastapi router

This commit is contained in:
Khalim Conn-Kowlessar 2023-07-20 12:44:31 +01:00
parent fb0c5859b9
commit 14ba7581d9
3 changed files with 5 additions and 3 deletions

2
.idea/Model.iml generated
View file

@ -6,7 +6,7 @@
<sourceFolder url="file://$MODULE_DIR$/model_data" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/open_uprn" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="Python 3.10 (conservation_areas)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.10 Model-fastapi" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

2
.idea/misc.xml generated
View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (conservation_areas)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 Model-fastapi" project-jdk-type="Python SDK" />
<component name="PythonCompatibilityInspectionAdvertiser">
<option name="version" value="3" />
</component>

View file

@ -76,7 +76,9 @@ async def trigger_plan(body: PlanTriggerRequest):
logger.info("Check if property is in conservation area")
for p in input_properties:
in_conservation_area = [x for x in in_conservation_area_data if x['uprn'] == int(p.data['uprn'])][0]
in_conservation_area = [x for x in in_conservation_area_data if x['uprn'] == int(p.data['uprn'])][0].get(
"is_in_conservation_area"
)
p.set_is_in_conservation_area(in_conservation_area)
return {"message": "Plan complete"}