diff --git a/osm_fieldwork/OdkCentral.py b/osm_fieldwork/OdkCentral.py index 8ca3881e..fd2a73fa 100755 --- a/osm_fieldwork/OdkCentral.py +++ b/osm_fieldwork/OdkCentral.py @@ -651,7 +651,7 @@ def listSubmissions(self, projectId: int, xform: str, filters: dict = None): result = self.session.get(url, auth=self.auth, params=filters, verify=self.verify) if result.ok: self.submissions = result.json() - return self.submissions["value"] + return self.submissions else: return list() @@ -961,13 +961,8 @@ def publishForm( log.info(f"Published {xform} on Central.") return result.status_code - - def form_fields(self, - projectId:int, - xform:str): - - """ - Retrieves the form fields for a xform from odk central. + def form_fields(self, projectId: int, xform: str): + """Retrieves the form fields for a xform from odk central. Args: projectId (int): The ID of the project on ODK Central @@ -977,17 +972,15 @@ def form_fields(self, dict: A json object containing the form fields. """ - if xform.find("_") > 0: - xid = xform.split('_')[2] + xid = xform.split("_")[2] else: xid = xform url = f"{self.base}projects/{projectId}/forms/{xid}/fields?odata=true" - result=self.session.get(url, auth=self.auth) + result = self.session.get(url, auth=self.auth) return result.json() - def dump(self): """Dump internal data structures, for debugging purposes only.""" # super().dump() diff --git a/osm_fieldwork/filter_data.py b/osm_fieldwork/filter_data.py index ae1d939d..e3be0fea 100755 --- a/osm_fieldwork/filter_data.py +++ b/osm_fieldwork/filter_data.py @@ -196,7 +196,7 @@ def cleanData( continue log.warning(f"Tag {key} not in the data model!") continue - if 'title' not in properties: + if "title" not in properties: properties["label"] = properties["id"] properties["title"] = properties["id"] newfeature = Feature(geometry=feature["geometry"], properties=properties)