Skip to content

Commit

Permalink
fix: updated category based on the available yaml file
Browse files Browse the repository at this point in the history
  • Loading branch information
sujanadh committed Sep 5, 2023
1 parent 91cc1ac commit 5fb445d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/backend/app/projects/project_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import segno
import shapely.wkb as wkblib
import sqlalchemy
import pkg_resources
from fastapi import File, HTTPException, UploadFile
from geoalchemy2.shape import from_shape
from geojson import dump
Expand Down Expand Up @@ -1044,9 +1045,15 @@ def read_xlsforms(
):
"""Read the list of XLSForms from the disk."""
xlsforms = list()
package_name = "osm_fieldwork"
for xls in os.listdir(directory):
if xls.endswith(".xls") or xls.endswith(".xlsx"):
xlsforms.append(xls)
file_name = xls.split(".")[0]
yaml_file_name = f"data_models/{file_name}.yaml"
if pkg_resources.resource_exists(package_name,yaml_file_name):
xlsforms.append(xls)
else:
continue
log.info(xls)
inspect(db_models.DbXForm)
forms = table(
Expand Down

0 comments on commit 5fb445d

Please sign in to comment.