From f2857394134c9f28c92b8ee15f10a1b5234311bd Mon Sep 17 00:00:00 2001 From: jrcastro2 Date: Fri, 29 Nov 2024 15:27:11 +0100 Subject: [PATCH] datastore: Fix domain fetching on None value --- invenio_accounts/datastore.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/invenio_accounts/datastore.py b/invenio_accounts/datastore.py index 98808247..5f0c2fb7 100644 --- a/invenio_accounts/datastore.py +++ b/invenio_accounts/datastore.py @@ -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)