Skip to content

Commit

Permalink
uow: improve decorator to create uow if it's None
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcastro2 committed Nov 14, 2024
1 parent 685ab6b commit 0fec1bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion invenio_db/uow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0fec1bf

Please sign in to comment.