diff --git a/osm_fieldwork/OdkCentral.py b/osm_fieldwork/OdkCentral.py index d59aca89e..72a7310b6 100755 --- a/osm_fieldwork/OdkCentral.py +++ b/osm_fieldwork/OdkCentral.py @@ -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"