aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2024-08-07 19:58:27 +0300
committerGitHub2024-08-07 19:58:27 +0300
commitdc43b8ba7593a239e7e2f38566fe68fc93ab3c93 (patch)
tree0a74c49cda70876b16f194889f87edfad806109a
parent0998033d0a7ea26ed96b00a360a334bae6de8c55 (diff)
parent6d763b5c8aece1b0442fecbc659c4da3456b4e75 (diff)
downloadgenenetwork2-dc43b8ba7593a239e7e2f38566fe68fc93ab3c93.tar.gz
Merge pull request #855 from jnduli/gn2_profiles_pages
Gn2 Fix profiles pages dashboard
-rw-r--r--gn2/wqflask/oauth2/ui.py11
-rw-r--r--gn2/wqflask/templates/oauth2/data-list-mrna.html2
2 files changed, 7 insertions, 6 deletions
diff --git a/gn2/wqflask/oauth2/ui.py b/gn2/wqflask/oauth2/ui.py
index 90d65e0b..04095420 100644
--- a/gn2/wqflask/oauth2/ui.py
+++ b/gn2/wqflask/oauth2/ui.py
@@ -1,16 +1,17 @@
"""UI utilities"""
-from flask import session, render_template
+from flask import render_template
from .client import oauth2_get
-from .client import user_logged_in
-from .request_utils import process_error
def render_ui(templatepath: str, **kwargs):
"""Handle repetitive UI rendering stuff."""
roles = kwargs.get("roles", tuple()) # Get roles
+ if not roles:
+ roles = oauth2_get("auth/system/roles").either(
+ lambda _err: roles, lambda auth_roles: auth_roles)
user_privileges = tuple(
- privilege for role in roles for privilege in role["privileges"])
+ privilege["privilege_id"] for role in roles for privilege in role["privileges"])
kwargs = {
- **kwargs, "roles": roles, "user_privileges": user_privileges
+ **kwargs, "roles": roles, "user_privileges": user_privileges,
}
return render_template(templatepath, **kwargs)
diff --git a/gn2/wqflask/templates/oauth2/data-list-mrna.html b/gn2/wqflask/templates/oauth2/data-list-mrna.html
index 728e95d4..c5c1c27e 100644
--- a/gn2/wqflask/templates/oauth2/data-list-mrna.html
+++ b/gn2/wqflask/templates/oauth2/data-list-mrna.html
@@ -92,7 +92,7 @@
<div class="row">
<span id="search-messages" class="alert-danger" style="display:none"></span>
<form id="frm-search"
- action="{{search_uri}}"
+ action="{{url_for('oauth2.data.json_search_mrna')}}"
method="POST">
<legend>Search: mRNA Assay</legend>
<input type="hidden" value="{{species_name}}" name="species"