Skip to content

Commit 66c478c

Browse files
committed
change reallocate handler to avoid cmd/event clash
1 parent 95cb05a commit 66c478c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/allocation/service_layer/handlers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,7 @@ def reallocate(
4343
event: events.Deallocated,
4444
uow: unit_of_work.AbstractUnitOfWork,
4545
):
46-
with uow:
47-
product = uow.products.get(sku=event.sku)
48-
product.events.append(commands.Allocate(**asdict(event)))
49-
uow.commit()
46+
allocate(commands.Allocate(**asdict(event)), uow=uow)
5047

5148

5249
def change_batch_quantity(

0 commit comments

Comments
 (0)