diff options
author | Frederick Muriuki Muriithi | 2024-06-17 16:00:21 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-06-17 16:00:21 -0500 |
commit | 4c82e3f6086eb03099dad6599c5a3b356c909cfd (patch) | |
tree | 40657c681186c5643a5a73fc9a2a61b91217bd1a | |
parent | 96bfa61529f543899a4599c824a3b27676e5118b (diff) | |
download | gn-auth-4c82e3f6086eb03099dad6599c5a3b356c909cfd.tar.gz |
Fix linting errors
-rw-r--r-- | gn_auth/auth/authorisation/resources/groups/views.py | 6 | ||||
-rw-r--r-- | gn_auth/auth/authorisation/resources/views.py | 3 |
2 files changed, 2 insertions, 7 deletions
diff --git a/gn_auth/auth/authorisation/resources/groups/views.py b/gn_auth/auth/authorisation/resources/groups/views.py index 73ba3bd..55db25a 100644 --- a/gn_auth/auth/authorisation/resources/groups/views.py +++ b/gn_auth/auth/authorisation/resources/groups/views.py @@ -3,8 +3,6 @@ The views/routes for the `gn3.auth.authorisation.resources.groups` package. """ import uuid import datetime -import warnings -from typing import Iterable from functools import partial from dataclasses import asdict @@ -15,10 +13,8 @@ from gn_auth.auth.db import sqlite3 as db from gn_auth.auth.db import mariadb as gn3db from gn_auth.auth.db.sqlite3 import with_db_connection -from gn_auth.auth.authorisation.roles.models import user_roles - from gn_auth.auth.authorisation.checks import authorised_p -from gn_auth.auth.authorisation.privileges import Privilege, privileges_by_ids +from gn_auth.auth.authorisation.privileges import privileges_by_ids from gn_auth.auth.errors import InvalidData, NotFoundError, AuthorisationError from gn_auth.auth.authentication.users import User diff --git a/gn_auth/auth/authorisation/resources/views.py b/gn_auth/auth/authorisation/resources/views.py index 07439a0..0e07ffa 100644 --- a/gn_auth/auth/authorisation/resources/views.py +++ b/gn_auth/auth/authorisation/resources/views.py @@ -617,8 +617,7 @@ def create_resource_role(resource_id: UUID): def user_resource_roles(resource_id: UUID, user_id: UUID): """Get a specific user's roles on a particular resource.""" with (require_oauth.acquire("profile group resource") as _token, - db.connection(app.config["AUTH_DB"]) as conn, - db.cursor(conn) as cursor): + db.connection(app.config["AUTH_DB"]) as conn): if _token.user.user_id != user_id: raise AuthorisationError( "You are not authorised to view the roles this user has.") |