Skip to content

Commit d53f9fa

Browse files
committed
Fix list_jobs, we should not pass data but params on GET requests
1 parent 0d1daea commit d53f9fa

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

qfieldcloud_sdk/sdk.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -898,13 +898,17 @@ def list_jobs(
898898
)
899899
```
900900
"""
901+
params = {
902+
"project_id": project_id,
903+
}
904+
905+
if job_type:
906+
params["type"] = job_type.value
907+
901908
payload = self._request_json(
902909
"GET",
903910
"jobs/",
904-
{
905-
"project_id": project_id,
906-
"type": job_type.value if job_type else None,
907-
},
911+
params=params,
908912
pagination=pagination,
909913
)
910914
return cast(List, payload)
@@ -1898,6 +1902,9 @@ def _request(
18981902
headers_copy = {**headers}
18991903

19001904
assert self.url
1905+
assert method != "GET" or not data, (
1906+
"GET requests must not have `data` values passed, use `params` instead"
1907+
)
19011908

19021909
allow_redirects = method != "POST"
19031910

0 commit comments

Comments
 (0)