From c125dfbbc34a78dda7b5b9a62763aacbf52f98ff Mon Sep 17 00:00:00 2001
From: BonfaceKilz
Date: Wed, 27 Oct 2021 14:23:24 +0300
Subject: Use correct predicate to see if a resource belongs to anyone
---
wqflask/wqflask/templates/admin/manage_resource.html | 2 +-
wqflask/wqflask/views.py | 10 ++++------
2 files changed, 5 insertions(+), 7 deletions(-)
(limited to 'wqflask')
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') %}
Resource Manager
- {% if resource_info.get('owner_id') != 'none'%}
+ {% if resource_info.get('owner_id') %}
{% set user_details = resource_info.get('owner_details') %}
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,
--
cgit v1.2.3