diff --git a/src/pretix/base/models/orders.py b/src/pretix/base/models/orders.py index 1b86ea7e6f..5ea12f70d0 100644 --- a/src/pretix/base/models/orders.py +++ b/src/pretix/base/models/orders.py @@ -423,10 +423,6 @@ class Order(LockModel, LoggedModel): """ return '{event}-{code}'.format(event=self.event.slug.upper(), code=self.code) - @property - def changable(self): - return self.status in (Order.STATUS_PAID, Order.STATUS_PENDING) - def save(self, **kwargs): if 'update_fields' in kwargs and 'last_modified' not in kwargs['update_fields']: kwargs['update_fields'] = list(kwargs['update_fields']) + ['last_modified'] diff --git a/src/pretix/base/services/orders.py b/src/pretix/base/services/orders.py index 3a42ab7b70..542bd36ce2 100644 --- a/src/pretix/base/services/orders.py +++ b/src/pretix/base/services/orders.py @@ -1228,7 +1228,6 @@ class OrderChangeManager: 'quota_missing': _('There is no quota defined that allows this operation.'), 'product_invalid': _('The selected product is not active or has no price set.'), 'complete_cancel': _('This operation would leave the order empty. Please cancel the order itself instead.'), - 'not_pending_or_paid': _('Only pending or paid orders can be changed.'), 'paid_to_free_exceeded': _('This operation would make the order free and therefore immediately paid, however ' 'no quota is available.'), 'addon_to_required': _('This is an add-on product, please select the base position it should be added to.'), @@ -1594,7 +1593,7 @@ class OrderChangeManager: self.order.status = Order.STATUS_CANCELED self.order.save(update_fields=['status']) order_canceled.send(self.order.event, order=self.order) - else: + elif self.order.status != Order.STATUS_CANCELED: # if the order becomes free, mark it paid using the 'free' provider # this could happen if positions have been made cheaper or removed (_totaldiff < 0) # or positions got split off to a new order (split_order with positive total) @@ -2082,11 +2081,10 @@ class OrderChangeManager: with transaction.atomic(): 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']) - if check_quotas: - self._check_quotas() - self._check_seats() + if self.order.status in (Order.STATUS_PENDING, Order.STATUS_PAID): + if check_quotas: + self._check_quotas() + self._check_seats() self._check_complete_cancel() self._check_and_lock_memberships() try: @@ -2094,7 +2092,8 @@ class OrderChangeManager: except TaxRule.SaleNotAllowed: raise OrderError(self.error_messages['tax_rule_country_blocked']) self._recalculate_total_and_payment_fee() - self._reissue_invoice() + if self.order.status in (Order.STATUS_PENDING, Order.STATUS_PAID): + self._reissue_invoice() self._clear_tickets_cache() self.order.touch() self._check_paid_price_change() diff --git a/src/pretix/control/templates/pretixcontrol/order/index.html b/src/pretix/control/templates/pretixcontrol/order/index.html index 141b8217f3..f2aacc7512 100644 --- a/src/pretix/control/templates/pretixcontrol/order/index.html +++ b/src/pretix/control/templates/pretixcontrol/order/index.html @@ -299,7 +299,7 @@ {% trans "Change answers" %} - {% if order.changable and 'can_change_orders' in request.eventpermset %} + {% if 'can_change_orders' in request.eventpermset %} · {% trans "Change products" %} @@ -822,7 +822,7 @@