diff options
author | BonfaceKilz | 2021-10-27 14:23:24 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-10-28 08:34:35 +0300 |
commit | c125dfbbc34a78dda7b5b9a62763aacbf52f98ff (patch) | |
tree | c0bfee3ec2c4f94fdb37fa7e5ba870cb00a6308b | |
parent | d15d381fd9018e9883d17046496250321327763b (diff) | |
download | genenetwork2-c125dfbbc34a78dda7b5b9a62763aacbf52f98ff.tar.gz |
Use correct predicate to see if a resource belongs to anyone
-rw-r--r-- | wqflask/wqflask/templates/admin/manage_resource.html | 2 | ||||
-rw-r--r-- | wqflask/wqflask/views.py | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/wqflask/wqflask/templates/admin/manage_resource.html b/wqflask/wqflask/templates/admin/manage_resource.html index 613aa70e..9ca75906 100644 --- a/wqflask/wqflask/templates/admin/manage_resource.html +++ b/wqflask/wqflask/templates/admin/manage_resource.html @@ -8,7 +8,7 @@ {% set METADATA_ACCESS = access_role.get('metadata') %} {% set ADMIN_STATUS = access_role.get('admin') %} <h1>Resource Manager</h1> - {% if resource_info.get('owner_id') != 'none'%} + {% if resource_info.get('owner_id') %} {% set user_details = resource_info.get('owner_details') %} <h3> Current Owner: {{ user_details.get('full_name') }} diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py index 963e48b7..665aabb0 100644 --- a/wqflask/wqflask/views.py +++ b/wqflask/wqflask/views.py @@ -608,9 +608,8 @@ def export_perm_data(): @app.route("/show_temp_trait", methods=('POST',)) def show_temp_trait_page(): - user_id = (g.user_session.record.get(b"user_id", - b"").decode("utf-8") or - g.user_session.record.get("user_id", "")) + user_id = ((g.user_session.record.get(b"user_id") or b"").decode("utf-8") + or g.user_session.record.get("user_id") or "") template_vars = show_trait.ShowTrait(user_id=user_id, kw=request.form) template_vars.js_data = json.dumps(template_vars.js_data, @@ -621,9 +620,8 @@ def show_temp_trait_page(): @app.route("/show_trait") def show_trait_page(): - user_id = (g.user_session.record.get(b"user_id", - b"").decode("utf-8") or - g.user_session.record.get("user_id", "")) + user_id = ((g.user_session.record.get(b"user_id") or b"").decode("utf-8") + or g.user_session.record.get("user_id") or "") template_vars = show_trait.ShowTrait(user_id=user_id, kw=request.args) template_vars.js_data = json.dumps(template_vars.js_data, |