diff --git a/invenio_accounts/datastore.py b/invenio_accounts/datastore.py index be4b799d..6db54f9f 100644 --- a/invenio_accounts/datastore.py +++ b/invenio_accounts/datastore.py @@ -115,6 +115,14 @@ def find_domain(self, domain): .one_or_none() ) + def find_domain_by_id(self, domain_id): + """Find a domain by id.""" + return ( + Domain.query.filter_by(id=domain_id) + .options(joinedload(Domain.category_name)) + .one_or_none() + ) + def create_domain(self, domain, **kwargs): """Create a new domain.""" return Domain.create(domain, **kwargs)