diff options
Diffstat (limited to 'gn_auth/auth/authorisation/roles/views.py')
| -rw-r--r-- | gn_auth/auth/authorisation/roles/views.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gn_auth/auth/authorisation/roles/views.py b/gn_auth/auth/authorisation/roles/views.py index 00def89..dda6f87 100644 --- a/gn_auth/auth/authorisation/roles/views.py +++ b/gn_auth/auth/authorisation/roles/views.py @@ -7,7 +7,7 @@ from flask import jsonify, Response, Blueprint, current_app from ...db import sqlite3 as db -from .models import user_role +from .models import role_by_id from ...authentication.oauth2.resource_server import require_oauth @@ -22,6 +22,4 @@ def view_role(role_id: uuid.UUID) -> Response: with require_oauth.acquire("profile role") as the_token: db_uri = current_app.config["AUTH_DB"] with db.connection(db_uri) as conn: - the_role = user_role(conn, the_token.user, role_id) - return the_role.either( - __error__, lambda a_role: jsonify((asdict(a_role[0]), str(a_role[1])))) + return jsonify(asdict(role_by_id(conn, role_id))) |
