Skip to content

Commit

Permalink
chore(logging): add additional logging around types in play
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Dec 18, 2024
1 parent 20b1fca commit 9f9607b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions eligibility_server/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def _check_user(self, sub, name, types):
if len(types) < 1:
logger.debug("List of types to check was empty.")
return []
else:
logger.debug(f"Types to check: {types}")

if self.hash:
sub = self.hash.hash_input(sub)
Expand All @@ -113,10 +115,12 @@ def _check_user(self, sub, name, types):
existing_user = User.query.filter_by(sub=sub, name=name).first()
if existing_user:
existing_user_types = [type.name for type in existing_user.types]
logger.debug(f"Existing types on user: {existing_user_types}")
else:
existing_user_types = []

matching_types = set(existing_user_types) & set(types)
logger.debug(f"Matching types: {matching_types}")

if existing_user is None:
logger.debug("Database does not contain requested user.")
Expand Down

0 comments on commit 9f9607b

Please sign in to comment.