From e754baaf51150156c159f59c8ba1fda0ba0a7269 Mon Sep 17 00:00:00 2001 From: zsloan Date: Mon, 31 Aug 2020 11:25:10 -0500 Subject: 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). --- wqflask/utility/redis_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wqflask/utility/redis_tools.py') 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 -- cgit v1.2.3