From 5f3c80e58f7728731d8cf3c5cf3f4f4fa5d198ec Mon Sep 17 00:00:00 2001 From: Ivan Ivanov Date: Fri, 12 Aug 2022 02:27:26 +0300 Subject: [PATCH] Do not attempt downloading public projects by default Fix the `include-public` param value from `true` to `1`. --- qfieldsync/core/cloud_api.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/qfieldsync/core/cloud_api.py b/qfieldsync/core/cloud_api.py index ce87faae..2266b6e6 100644 --- a/qfieldsync/core/cloud_api.py +++ b/qfieldsync/core/cloud_api.py @@ -281,16 +281,15 @@ def logout(self) -> QNetworkReply: return reply - def get_projects(self, should_include_public: bool = True) -> QNetworkReply: + def get_projects(self, should_include_public: bool = False) -> QNetworkReply: """Get QFieldCloud projects""" - return self.cloud_get( - "projects", {"include-public": "true" if should_include_public else "false"} - ) + params = {"include-public": "1"} if should_include_public else {} + return self.cloud_get("projects", params) def get_projects_not_async(self, should_include_public: bool = False) -> List[Dict]: """Get QFieldCloud projects synchronously""" headers = {"Authorization": "token {}".format(self._token)} - params = {"include-public": should_include_public} + params = {"include-public": "1"} if should_include_public else {} response = requests.get( self._prepare_uri("projects").toString(),