about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--gn_auth/auth/authorisation/users/collections/models.py4
-rw-r--r--gn_auth/auth/authorisation/users/views.py4
-rwxr-xr-xsetup.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/gn_auth/auth/authorisation/users/collections/models.py b/gn_auth/auth/authorisation/users/collections/models.py
index 63443ef..30242c2 100644
--- a/gn_auth/auth/authorisation/users/collections/models.py
+++ b/gn_auth/auth/authorisation/users/collections/models.py
@@ -72,8 +72,8 @@ def __retrieve_old_accounts__(rconn: Redis) -> dict:
 
 def parse_collection(coll: dict) -> dict:
     """Parse the collection as persisted in redis to a usable python object."""
-    created = coll.get("created", coll.get("created_timestamp"))
-    changed = coll.get("changed", coll.get("changed_timestamp"))
+    created = coll.get("created", coll.get("created_timestamp", ""))
+    changed = coll.get("changed", coll.get("changed_timestamp", ""))
     return {
         "id": UUID(coll["id"]),
         "name": coll["name"],
diff --git a/gn_auth/auth/authorisation/users/views.py b/gn_auth/auth/authorisation/users/views.py
index cae2605..c248ac3 100644
--- a/gn_auth/auth/authorisation/users/views.py
+++ b/gn_auth/auth/authorisation/users/views.py
@@ -4,9 +4,9 @@ import sqlite3
 import secrets
 import traceback
 from dataclasses import asdict
-from typing import Any, Sequence
 from urllib.parse import urljoin
 from functools import reduce, partial
+from typing import Any, Union, Sequence
 from datetime import datetime, timedelta
 from email.headerregistry import Address
 from email_validator import validate_email, EmailNotValidError
@@ -80,7 +80,7 @@ def user_details() -> Response:
             })
 
 @users.route("/<user_id>", methods=["GET"])
-def get_user(user_id: str) -> Response:
+def get_user(user_id: str) -> Union[Response, tuple[Response, int]]:
     """Fetch user details by user_id."""
     try:
         with db.connection(current_app.config["AUTH_DB"]) as conn:
diff --git a/setup.py b/setup.py
index 59cd86f..c7339e2 100755
--- a/setup.py
+++ b/setup.py
@@ -44,5 +44,5 @@ setup(author="Frederick M. Muriithi",
       version="0.0.1",
       tests_require=["pytest", "hypothesis"],
       cmdclass={
-          "run_tests": RunTests  # testing
+          "run_tests": RunTests  # type: ignore[dict-item]
       })