diff options
author | zsloan | 2020-10-08 14:36:25 -0500 |
---|---|---|
committer | GitHub | 2020-10-08 14:36:25 -0500 |
commit | 5880b399efbc0175e726be5a61945c30a5fe6260 (patch) | |
tree | 862ac51c238c68ce383235d4b9d3e6a3e52f2a58 | |
parent | 4f47ebdac92a4255c9a12aa7235affc777114268 (diff) | |
parent | 8c0ab33592e29bf6bae14ba4831dde8a53a27363 (diff) | |
download | genenetwork2-5880b399efbc0175e726be5a61945c30a5fe6260.tar.gz |
Merge pull request #452 from zsloan/authentication_bug_fix
Checked if owner_id is "none" to avoid an error when trying to access…
-rw-r--r-- | wqflask/wqflask/resource_manager.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/wqflask/wqflask/resource_manager.py b/wqflask/wqflask/resource_manager.py index 39a07310..14ff2183 100644 --- a/wqflask/wqflask/resource_manager.py +++ b/wqflask/wqflask/resource_manager.py @@ -25,16 +25,16 @@ def manage_resource(): group_masks_with_names = get_group_names(group_masks) default_mask = resource_info['default_mask']['data'] owner_id = resource_info['owner_id'] - owner_info = get_user_by_unique_column("user_id", owner_id) - - if 'name' in owner_info: - owner_display_name = owner_info['full_name'] - elif 'user_name' in owner_info: - owner_display_name = owner_info['user_name'] - elif 'email_address' in owner_info: - owner_display_name = owner_info['email_address'] - else: - owner_display_name = None + + owner_display_name = None + if owner_id != "none": + owner_info = get_user_by_unique_column("user_id", owner_id) + if 'name' in owner_info: + owner_display_name = owner_info['full_name'] + elif 'user_name' in owner_info: + owner_display_name = owner_info['user_name'] + elif 'email_address' in owner_info: + owner_display_name = owner_info['email_address'] return render_template("admin/manage_resource.html", owner_name = owner_display_name, resource_id = resource_id, resource_info=resource_info, default_mask=default_mask, group_masks=group_masks_with_names, admin_status=admin_status) |