mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Allow to disable self-choice seating
This commit is contained in:
@@ -399,7 +399,10 @@ class OrderPositionChangeForm(forms.Form):
|
||||
self.fields['tax_rule'].queryset = instance.event.tax_rules.all()
|
||||
self.fields['tax_rule'].label_from_instance = self.taxrule_label_from_instance
|
||||
|
||||
if not instance.seat:
|
||||
if not instance.seat and not (
|
||||
not instance.event.settings.seating_choice and
|
||||
instance.item.seat_category_mappings.filter(subevent=instance.subevent).exists()
|
||||
):
|
||||
del self.fields['seat']
|
||||
|
||||
choices = [
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if position.seat %}
|
||||
{% if position.form.seat %}
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<strong>{% trans "Seat" %}</strong>
|
||||
|
||||
@@ -1514,7 +1514,7 @@ class OrderChange(OrderView):
|
||||
elif change_subevent is not None:
|
||||
ocm.change_subevent(p, *change_subevent)
|
||||
|
||||
if p.seat and p.form.cleaned_data['seat'] and p.form.cleaned_data['seat'] != p.seat.seat_guid:
|
||||
if p.form.cleaned_data.get('seat') and (not p.seat or p.form.cleaned_data['seat'] != p.seat.seat_guid):
|
||||
ocm.change_seat(p, p.form.cleaned_data['seat'])
|
||||
|
||||
if p.form.cleaned_data['price'] is not None and p.form.cleaned_data['price'] != p.price:
|
||||
|
||||
@@ -26,8 +26,8 @@ from django.views.generic import (
|
||||
from pretix.api.models import WebHook
|
||||
from pretix.base.auth import get_auth_backends
|
||||
from pretix.base.models import (
|
||||
CachedFile, Device, GiftCard, OrderPayment, Organizer, Team, TeamInvite,
|
||||
User, LogEntry,
|
||||
CachedFile, Device, GiftCard, LogEntry, OrderPayment, Organizer, Team,
|
||||
TeamInvite, User,
|
||||
)
|
||||
from pretix.base.models.event import Event, EventMetaProperty, EventMetaValue
|
||||
from pretix.base.models.giftcards import gen_giftcard_secret
|
||||
|
||||
Reference in New Issue
Block a user