Skip to content

Commit 311491f

Browse files
committed
change reallocate handler to avoid cmd/event clash
1 parent 680ad15 commit 311491f

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
@@ -41,10 +41,7 @@ def allocate(
4141
def reallocate(
4242
event: events.Deallocated, uow: unit_of_work.AbstractUnitOfWork
4343
):
44-
with uow:
45-
product = uow.products.get(sku=event.sku)
46-
product.events.append(commands.Allocate(**asdict(event)))
47-
uow.commit()
44+
allocate(commands.Allocate(**asdict(event)), uow=uow)
4845

4946

5047
def change_batch_quantity(

0 commit comments

Comments
 (0)