mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Do not allow customers to cancel checked-in orders
This commit is contained in:
@@ -15,7 +15,7 @@ from django.utils.timezone import now
|
||||
|
||||
from pretix.base.i18n import language
|
||||
from pretix.base.models import (
|
||||
CachedFile, CartPosition, CheckinList, Event, Item, ItemCategory,
|
||||
CachedFile, CartPosition, Checkin, CheckinList, Event, Item, ItemCategory,
|
||||
ItemVariation, Order, OrderFee, OrderPayment, OrderPosition, OrderRefund,
|
||||
Organizer, Question, Quota, User, Voucher, WaitingListEntry,
|
||||
)
|
||||
@@ -865,6 +865,18 @@ class OrderTestCase(BaseQuotaTestCase):
|
||||
self.event.settings.cancel_allow_user_paid = True
|
||||
assert self.order.user_cancel_allowed
|
||||
|
||||
def test_can_cancel_checked_in(self):
|
||||
self.order.status = Order.STATUS_PAID
|
||||
self.order.save()
|
||||
self.event.settings.cancel_allow_user = False
|
||||
self.event.settings.cancel_allow_user_paid = True
|
||||
assert self.order.user_cancel_allowed
|
||||
Checkin.objects.create(
|
||||
position=self.order.positions.first(),
|
||||
list=CheckinList.objects.create(event=self.event, name='Default')
|
||||
)
|
||||
assert not self.order.user_cancel_allowed
|
||||
|
||||
def test_can_cancel_order_multiple(self):
|
||||
item1 = Item.objects.create(event=self.event, name="Ticket", default_price=23,
|
||||
admission=True, allow_cancel=True)
|
||||
|
||||
Reference in New Issue
Block a user