Skip to content

Commit

Permalink
fix: more flexible parsing of xform name for uploadMedia
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Feb 26, 2024
1 parent 7f41ea7 commit 1fc46dc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion osm_fieldwork/OdkCentral.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,11 @@ def uploadMedia(
"""
title = os.path.basename(os.path.splitext(filespec)[0])
datafile = f"{title}.geojson"
xid = xform.split("_")[2]

if xform.find("_") > 0:
xid = xform.split("_")[2]
else:
xid = xform

if convert_to_draft:
url = f"{self.base}projects/{projectId}/forms/{xid}/draft"
Expand Down

0 comments on commit 1fc46dc

Please sign in to comment.