diff --git a/invenio_db/uow.py b/invenio_db/uow.py index 73ec442..4b80fd4 100644 --- a/invenio_db/uow.py +++ b/invenio_db/uow.py @@ -242,7 +242,7 @@ def aservice_method(self, ...., uow=None): def decorator(f): @wraps(f) def inner(self, *args, **kwargs): - if "uow" not in kwargs: + if "uow" not in kwargs or kwargs["uow"] is None: # Migration path - start a UoW and commit with UnitOfWork(db.session) as uow: kwargs["uow"] = uow