Skip to content

Commit

Permalink
fix: replace form_category to form_name
Browse files Browse the repository at this point in the history
  • Loading branch information
Sujanadh committed Feb 27, 2025
1 parent 89e881e commit 60ca9dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/backend/app/osm_fieldwork/make_data_extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def main():
if args.verbose is not None:
logging.basicConfig(
level=logging.DEBUG,
format=("%(asctime)s.%(msecs)03d [%(levelname)s] " "%(name)s | %(funcName)s:%(lineno)d | %(message)s"),
format=("%(asctime)s.%(msecs)03d [%(levelname)s] %(name)s | %(funcName)s:%(lineno)d | %(message)s"),
datefmt="%y-%m-%d %H:%M:%S",
stream=sys.stdout,
)
Expand Down
10 changes: 5 additions & 5 deletions src/backend/app/projects/project_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ async def generate_files(
"""
project = project_user_dict.get("project")
project_id = project.id
form_category = project.xform_category
form_name = project.xform_category
new_geom_type = project.new_geom_type

log.debug(f"Generating additional files for project: {project.id}")
Expand All @@ -930,23 +930,23 @@ async def generate_files(
# Validate uploaded form
await central_crud.validate_and_update_user_xlsform(
xlsform=xlsform_upload,
form_category=form_category,
form_name=form_name,
additional_entities=additional_entities,
new_geom_type=new_geom_type,
)
xlsform = xlsform_upload

else:
log.debug(f"Using default XLSForm for category: '{form_category}'")
log.debug(f"Using default XLSForm for category: '{form_name}'")

form_filename = XLSFormType(form_category).name
form_filename = XLSFormType(form_name).name
xlsform_path = f"{xlsforms_path}/{form_filename}.xls"
with open(xlsform_path, "rb") as f:
xlsform = BytesIO(f.read())

xform_id, project_xlsform = await central_crud.append_fields_to_user_xlsform(
xlsform=xlsform,
form_category=form_category,
form_name=form_name,
additional_entities=additional_entities,
new_geom_type=new_geom_type,
)
Expand Down

0 comments on commit 60ca9dc

Please sign in to comment.