about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-09-07 15:51:14 +0300
committerFrederick Muriuki Muriithi2023-10-10 11:12:50 +0300
commitdf0ac11ff12d1f4c0176ef86f06ce4c7ac26c99e (patch)
tree6df9180f4a889d4cb1551e526911a54c61edd5ed
parent3e06396c8966250540e72f7fa909b78dd10a5534 (diff)
downloadgenenetwork3-df0ac11ff12d1f4c0176ef86f06ce4c7ac26c99e.tar.gz
Update imports
Update imports after removing the authentication from GN3
-rw-r--r--gn3/case_attributes.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/gn3/case_attributes.py b/gn3/case_attributes.py
index 04df030..695298a 100644
--- a/gn3/case_attributes.py
+++ b/gn3/case_attributes.py
@@ -14,10 +14,9 @@ from gn3.commands import run_cmd
 
 from gn3.db_utils import Connection, database_connection
 
-from gn3.auth.authentication.users import User
-from gn3.auth.authentication.oauth2.resource_server import require_oauth
-
+from gn3.auth.authorisation.users import User
 from gn3.auth.authorisation.errors import AuthorisationError
+from gn3.auth.authorisation.oauth2.resource_server import require_oauth
 
 caseattr = Blueprint("case-attribute", __name__)
 
@@ -154,8 +153,8 @@ def __process_edit_data__(fieldnames, form_data) -> tuple[dict, ...]:
 
 def __write_csv__(fieldnames, data):
     """Write the given `data` to a csv file and return the path to the file."""
-    fd, filepath = tempfile.mkstemp(".csv")
-    os.close(fd)
+    fdesc, filepath = tempfile.mkstemp(".csv")
+    os.close(fdesc)
     with open(filepath, "w", encoding="utf-8") as csvfile:
         writer = csv.DictWriter(csvfile, fieldnames=fieldnames, dialect="unix")
         writer.writeheader()
@@ -163,7 +162,10 @@ def __write_csv__(fieldnames, data):
 
     return filepath
 
-def __compute_diff__(fieldnames: tuple[str, ...], original_data: tuple[dict, ...], edit_data: tuple[dict, ...]):
+def __compute_diff__(
+        fieldnames: tuple[str, ...],
+        original_data: tuple[dict, ...],
+        edit_data: tuple[dict, ...]):
     """Return the diff of the data."""
     basefilename = __write_csv__(fieldnames, original_data)
     deltafilename = __write_csv__(fieldnames, edit_data)