Skip to content

Commit 2b2e03c

Browse files
committed
refactor: minor refactors, remove print statements
1 parent ab9f3c7 commit 2b2e03c

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

src/backend/app/projects/project_routes.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -806,16 +806,12 @@ async def generate_files(
806806
project = project_user_dict.get("project")
807807
project_id = project.id
808808
new_geom_type = project.new_geom_type
809-
810-
# Project requirement if they need to use odk-collect
811809
use_odk_collect = project.use_odk_collect or False
812-
813-
log.debug(f"Generating additional files for project: {project.id}")
814-
815810
form_name = f"FMTM_Project_{project.id}"
816-
817811
project_contains_existing_feature = True if combined_features_count else False
818812

813+
log.debug(f"Generating additional files for project: {project.id}")
814+
819815
# Validate uploaded form
820816
await central_crud.validate_and_update_user_xlsform(
821817
xlsform=xlsform_upload,

src/backend/packages/osm-fieldwork/osm_fieldwork/update_xlsform.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,6 @@ def merge_dataframes(
191191
# We wrap the survey question in a group to easily disable all questions if the
192192
# feature does not exist. If we don't have the `feature_exists` question, then
193193
# wrapping in the group is unnecessary (all groups are flattened in processing anyway)
194-
print("")
195-
print("")
196-
print("")
197-
print(need_verification)
198-
print("")
199-
print("")
200-
201194
if need_verification:
202195
survey_group = {
203196
"begin": (
@@ -352,10 +345,11 @@ def _get_form_components(
352345
need_verification_fields: bool
353346
) -> dict:
354347
"""Select appropriate form components based on target platform."""
348+
# only add verification questions if new feature type is Polygon
349+
need_verification_fields = new_geom_type == DbGeomType.POLYGON and need_verification_fields
350+
355351
if use_odk_collect:
356-
# only add verification questions if new feature type is Polygon
357-
need_verification_fields = new_geom_type == DbGeomType.POLYGON and need_verification_fields
358-
# modify digitisation_df to include the `new_feature` field
352+
# Here we modify digitisation_df to include the `new_feature` field
359353
# NOTE we set digitisation_correct to 'yes' if the user is drawing a new geometry
360354
digitisation_correct_col = digitisation_df["name"] == "digitisation_correct"
361355
digitisation_df.loc[digitisation_correct_col, "calculation"] = "once(if(${new_feature} != '', 'yes', ''))"

src/mapper/src/lib/components/map/main.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,6 @@
590590
geojsonUpdateDependency={[entityMapByEntity, entityMapByOsm]}
591591
>
592592
{#if primaryGeomType === MapGeomTypes.POLYGON}
593-
<!-- TODO: colors values should be dynamic -->
594593
<FillLayer
595594
id="entity-polygon-layer"
596595
paint={{
@@ -627,7 +626,6 @@
627626
beforeLayerType="symbol"
628627
manageHoverState
629628
/>
630-
<!-- TODO: colors values should be dynamic -->
631629
<LineLayer
632630
layout={{ 'line-cap': 'round', 'line-join': 'round' }}
633631
paint={{
@@ -639,7 +637,6 @@
639637
manageHoverState
640638
/>
641639
{:else if primaryGeomType === MapGeomTypes.POINT}
642-
<!-- TODO: colors values should be dynamic -->
643640
<SymbolLayer
644641
id="entity-point-layer"
645642
applyToClusters={false}

0 commit comments

Comments
 (0)