diff options
author | BonfaceKilz | 2020-08-31 13:59:07 +0300 |
---|---|---|
committer | BonfaceKilz | 2020-08-31 13:59:07 +0300 |
commit | 244baa887e89a59423d4d0ffc3701b7119ceaecc (patch) | |
tree | b9c1f88936223e486c0bac0fa5ccdf7f12900a95 /wqflask/utility/authentication_tools.py | |
parent | 45323bed6b567f8bd3c87f5fbe610cd602d228bc (diff) | |
parent | dba31ef2aa9e3f89621848fdb79b915dbd3c56e2 (diff) | |
download | genenetwork2-244baa887e89a59423d4d0ffc3701b7119ceaecc.tar.gz |
Merge branch 'testing' into build/python3-migration
Diffstat (limited to 'wqflask/utility/authentication_tools.py')
-rw-r--r-- | wqflask/utility/authentication_tools.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/wqflask/utility/authentication_tools.py b/wqflask/utility/authentication_tools.py index 73c39399..68bbb276 100644 --- a/wqflask/utility/authentication_tools.py +++ b/wqflask/utility/authentication_tools.py @@ -77,7 +77,10 @@ def add_new_resource(dataset, trait_id=None): def get_group_code(dataset): results = g.db.execute("SELECT InbredSetCode from InbredSet where Name='{}'".format(dataset.group.name)).fetchone() - return results[0] + if results[0]: + return results[0] + else: + return "" def check_admin(resource_id=None): the_url = "http://localhost:8080/available?resource={}&user={}".format(resource_id, g.user_session.user_id) @@ -85,7 +88,7 @@ def check_admin(resource_id=None): response = json.loads(requests.get(the_url).content)['admin'] except: resource_info = get_resource_info(resource_id) - response = resource_info['default_mask']['admin'] +l response = resource_info['default_mask']['admin'] if 'edit-admins' in response: return "edit-admins" |