Order change: Allow to ignore quotas

This commit is contained in:
Raphael Michel
2019-02-11 16:15:54 +01:00
parent d073007fd7
commit f23de7e2c0
5 changed files with 19 additions and 3 deletions

View File

@@ -1306,7 +1306,7 @@ class OrderChangeManager:
except SendMailException:
logger.exception('Order changed email could not be sent')
def commit(self):
def commit(self, check_quotas=True):
if self._committed:
# an order change can only be committed once
raise OrderError(error_messages['internal'])
@@ -1323,7 +1323,8 @@ class OrderChangeManager:
with self.order.event.lock():
if self.order.status not in (Order.STATUS_PENDING, Order.STATUS_PAID):
raise OrderError(self.error_messages['not_pending_or_paid'])
self._check_quotas()
if check_quotas:
self._check_quotas()
self._check_complete_cancel()
self._perform_operations()
self._recalculate_total_and_payment_fee()