diff options
author | Frederick Muriuki Muriithi | 2024-07-17 14:34:17 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-07-17 14:34:17 -0500 |
commit | 2e6f8a5d6bde0bd8fdfb9217b352ea2914ba592f (patch) | |
tree | f23f0a9495a2a25fca0f90bbcd3969734fc0d379 | |
parent | 2aa4d3f683733899edd58831ed6c413349167725 (diff) | |
download | gn-auth-2e6f8a5d6bde0bd8fdfb9217b352ea2914ba592f.tar.gz |
Fix linting issues
-rw-r--r-- | scripts/batch_assign_data_to_default_admin.py | 10 | ||||
-rw-r--r-- | scripts/link_inbredsets.py | 3 |
2 files changed, 6 insertions, 7 deletions
diff --git a/scripts/batch_assign_data_to_default_admin.py b/scripts/batch_assign_data_to_default_admin.py index 1f6c9c9..3df123d 100644 --- a/scripts/batch_assign_data_to_default_admin.py +++ b/scripts/batch_assign_data_to_default_admin.py @@ -7,9 +7,8 @@ import logging from pathlib import Path import click -from MySQLdb.cursors import DictCursor from pymonad.maybe import Just, Maybe, Nothing -from pymonad.tools import curry, monad_from_none_or_value +from pymonad.tools import monad_from_none_or_value from gn_auth.auth.db import mariadb as biodb from gn_auth.auth.db import sqlite3 as authdb @@ -50,7 +49,6 @@ def resource_owner(conn: authdb.DbConnection) -> Maybe: User.from_sqlite3_row) - def assign_data(authconn: authdb.DbConnection, bioconn, group: Group): """Do actual data assignments.""" try: @@ -58,10 +56,10 @@ def assign_data(authconn: authdb.DbConnection, bioconn, group: Group): assign_data_to_resource(authconn, bioconn, resource, group) return 1 - except Exception as _exc: + except Exception as _exc:# pylint: disable=[broad-except] logging.error("Failed to assign some data!", exc_info=True) return 1 - + if __name__ == "__main__": @click.command() @@ -86,4 +84,4 @@ if __name__ == "__main__": logging.error("There is no such SQLite3 database file.") return 1 - sys.exit(run()) + sys.exit(run()) # pylint: disable=[no-value-for-parameter] diff --git a/scripts/link_inbredsets.py b/scripts/link_inbredsets.py index ac9fa2b..5db7ea8 100644 --- a/scripts/link_inbredsets.py +++ b/scripts/link_inbredsets.py @@ -11,7 +11,8 @@ import gn_auth.auth.db.sqlite3 as authdb from gn_auth.auth.db import mariadb as biodb -from scripts.migrate_existing_data import sys_admins, admin_group, select_sys_admin +from scripts.assign_data_to_default_admin import ( + sys_admins, admin_group, select_sys_admin) def linked_inbredsets(conn): """Fetch all inbredset groups that are linked to the auth system.""" |