From ae78a597a29fa31b29e1126ba6538b18f5f61344 Mon Sep 17 00:00:00 2001 From: Jules Grillot <37152611+JulesGrillot@users.noreply.github.com> Date: Mon, 19 Feb 2024 15:44:14 +0100 Subject: [PATCH] Update QRealTime_dialog.py Correction for ODK Central, typo with urljoin and api changes selectedFormName is now extracted from "xmlFormId" and not "name". https://docs.getodk.org/central-api-form-management/#retrieving-form-xml --- QRealTime_dialog.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QRealTime_dialog.py b/QRealTime_dialog.py index 393be04..adfa75a 100644 --- a/QRealTime_dialog.py +++ b/QRealTime_dialog.py @@ -1077,10 +1077,10 @@ def importData(self,layer,selectedForm,doImportData=True): form_response = requests.get(urljoin(c_url,"v1/projects/"+ str(project_id)+"/forms/"), headers={"Authorization": "Bearer " + Central.usertoken}) for form in form_response.json(): if form ["enketoOnceId"] == selectedForm: - selectedFormName = form["name"] + selectedFormName = form["xmlFormId"] Central.form_name = selectedFormName try: - response = requests.get(urljon(c_url,'v1/projects/'+str(project_id)+'/forms/'+ selectedForm+'.xml'), headers ={"Authorization": "Bearer " + Central.usertoken}) + response = requests.get(urljoin(c_url,'v1/projects/'+str(project_id)+'/forms/'+ selectedFormName +'.xml'), headers ={"Authorization": "Bearer " + Central.usertoken}) except: self.iface.messageBar().pushCritical(self.tag,self.tr("Invalid url,username or password")) return