aboutsummaryrefslogtreecommitdiff
path: root/wqflask/utility
diff options
context:
space:
mode:
authorzsloan2020-08-31 11:25:10 -0500
committerzsloan2020-08-31 11:25:10 -0500
commite754baaf51150156c159f59c8ba1fda0ba0a7269 (patch)
treefe44e604ce38f069cb7dafe0a152f000960e6f98 /wqflask/utility
parentdba31ef2aa9e3f89621848fdb79b915dbd3c56e2 (diff)
downloadgenenetwork2-e754baaf51150156c159f59c8ba1fda0ba0a7269.tar.gz
Fixed issue that was causing updating resource default privileges to not
work * wqflask/utility/redis_tools.py - There was an issue where resources wouldn't be updated if they already existed. This is because the code didn't yet account for the "update" tag (that is meant to give the option of preventing updating resources when running the script to enter all resources into Redis). I changed the logic to add a resource if "update" is True or the resource doesn't already exist (so it won't if update is False and the resource exists).
Diffstat (limited to 'wqflask/utility')
-rw-r--r--wqflask/utility/redis_tools.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/wqflask/utility/redis_tools.py b/wqflask/utility/redis_tools.py
index 1377a564..81ba04ea 100644
--- a/wqflask/utility/redis_tools.py
+++ b/wqflask/utility/redis_tools.py
@@ -288,7 +288,7 @@ def add_resource(resource_info, update=True):
else:
resource_id = hmac.hmac_creation('{}:{}'.format(str(resource_info['type']), str(resource_info['data']['dataset'])))
- if not Redis.hexists("resources", resource_id):
+ if update or not Redis.hexists("resources", resource_id):
Redis.hset("resources", resource_id, json.dumps(resource_info))
return resource_info