Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilem Duha <vilem.duha@gmail.com>2019-05-09 00:09:11 +0300
committerVilem Duha <vilem.duha@gmail.com>2019-05-19 16:45:49 +0300
commit06ecc07ed0435400864c98ae3b0f05210d6be6ff (patch)
tree73267e19617b2bca5b3c6770d6a06bb9cd0d1e01 /blenderkit/upload.py
parent9be41665fdc77a4cbe29451e13106d70f239cf4a (diff)
BlenderKit: improve api key saving
Diffstat (limited to 'blenderkit/upload.py')
-rw-r--r--blenderkit/upload.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/blenderkit/upload.py b/blenderkit/upload.py
index 30e17f27..06afd1ef 100644
--- a/blenderkit/upload.py
+++ b/blenderkit/upload.py
@@ -501,6 +501,7 @@ def get_upload_location(props):
return None
return None
+
def check_storage_quota(props):
if not props.is_private:
return True
@@ -514,12 +515,13 @@ def check_storage_quota(props):
return False
search.write_profile(adata)
profile = adata
- print(profile.keys())
- if profile['user'].get('remainingPrivateQuota')>0:
+ quota = profile['user'].get('remainingPrivateQuota')
+ if quota is None or quota > 0:
return True
props.report = 'Private storage quota exceeded.'
return False
+
def start_upload(self, context, asset_type, as_new, metadata_only):
props = utils.get_upload_props()
storage_quota_ok = check_storage_quota(props)
@@ -618,7 +620,6 @@ def start_upload(self, context, asset_type, as_new, metadata_only):
props.uploading = False
return {'CANCELLED'}
-
# props.upload_state = 'step 1'
if metadata_only:
props.uploading = False
@@ -717,7 +718,7 @@ class ModelUploadOperator(Operator):
self.metadata_only = False
props.name_changed = False
- result = start_upload(self, context, self.asset_type, self.as_new, self.metadata_only)
+ result = start_upload(self, context, self.asset_type, self.as_new, self.metadata_only)
return result