56
56
from qfieldsync .core .preferences import Preferences
57
57
from qfieldsync .utils .qt_utils import strip_html
58
58
59
+ LOCALIZED_DATASETS_PROJECT_NAME = "shared_datasets"
60
+
59
61
60
62
class CloudException (Exception ):
61
63
def __init__ (self , reply , exception : Optional [Exception ] = None ):
@@ -755,20 +757,26 @@ def get_or_create_localized_datasets_project(
755
757
try :
756
758
# Check if the project is already in the projects cache
757
759
for project in self .projects_cache .projects :
758
- if project .name == "localized_datasets" and project .owner == owner :
760
+ if (
761
+ project .name == LOCALIZED_DATASETS_PROJECT_NAME
762
+ and project .owner == owner
763
+ ):
759
764
return project
760
765
761
766
# If not, refresh the projects cache and check again
762
767
self .projects_cache .refresh_not_async ()
763
768
for project in self .projects_cache .projects :
764
- if project .name == "localized_datasets" and project .owner == owner :
769
+ if (
770
+ project .name == LOCALIZED_DATASETS_PROJECT_NAME
771
+ and project .owner == owner
772
+ ):
765
773
return project
766
774
767
775
# We're finally sure it's not present yet, create one
768
776
reply = self .create_project (
769
- name = "localized_datasets" ,
777
+ name = LOCALIZED_DATASETS_PROJECT_NAME ,
770
778
owner = owner ,
771
- description = "Localized datasets " ,
779
+ description = "" ,
772
780
private = True ,
773
781
)
774
782
loop = QEventLoop ()
@@ -777,7 +785,10 @@ def get_or_create_localized_datasets_project(
777
785
778
786
self .projects_cache .refresh_not_async ()
779
787
for project in self .projects_cache .projects :
780
- if project .name == "localized_datasets" and project .owner == owner :
788
+ if (
789
+ project .name == LOCALIZED_DATASETS_PROJECT_NAME
790
+ and project .owner == owner
791
+ ):
781
792
return project
782
793
783
794
except Exception as err :
0 commit comments