mirror of
https://github.com/pretix/pretix.git
synced 2026-08-11 10:57:00 +00:00
API: Fix order total after order change operation (#2700)
This commit is contained in:
@@ -2304,6 +2304,11 @@ class OrderChangeManager:
|
||||
# Do nothing
|
||||
return
|
||||
|
||||
# Clear prefetched objects cache of order. We're going to modify the positions and fees and we have no guarantee
|
||||
# that every operation tuple points to a position/fee instance that has been fetched from the same object cache,
|
||||
# so it's dangerous to keep the cache around.
|
||||
self.order._prefetched_objects_cache = {}
|
||||
|
||||
# finally, incorporate difference in payment fees
|
||||
self._payment_fee_diff()
|
||||
|
||||
|
||||
@@ -1673,6 +1673,8 @@ def test_order_change_patch(token_client, organizer, event, order, quota):
|
||||
assert p.item == item2
|
||||
f.refresh_from_db()
|
||||
assert f.value == Decimal('10.00')
|
||||
order.refresh_from_db()
|
||||
assert order.total == Decimal('109.44')
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
||||
Reference in New Issue
Block a user