Skip to content

Commit

Permalink
datastore: Fix domain fetching on None value
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Nov 29, 2024
1 parent cd6bfe2 commit f285739
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions invenio_accounts/datastore.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ def find_role_by_id(self, role_id):

def find_domain(self, domain_or_id):
"""Find a domain by value or ID."""
if domain_or_id is None:
return None

if isinstance(domain_or_id, str):
if domain_or_id.isdigit():
clause = Domain.id == int(domain_or_id)
Expand Down

0 comments on commit f285739

Please sign in to comment.