diff --git a/doc/api/resources/items.rst b/doc/api/resources/items.rst index 02edb5b0b7..ab53542bb7 100644 --- a/doc/api/resources/items.rst +++ b/doc/api/resources/items.rst @@ -75,6 +75,8 @@ generate_tickets boolean If ``false``, t non-admission or add-on product, regardless of event settings. If this is ``null``, regular ticketing rules apply. +allow_waitinglist boolean If ``false``, no waiting list will be shown for this + product when it is sold out. show_quota_left boolean Publicly show how many tickets are still available. If this is ``null``, the event default is used. has_variations boolean Shows whether or not this item has variations. @@ -149,7 +151,7 @@ bundles list of objects Definition of b .. versionchanged:: 3.0 - The ``show_quota_left`` and ``hidden_if_available`` attributes have been added. + The ``show_quota_left``, ``allow_waitinglist``, and ``hidden_if_available`` attributes have been added. Notes ----- @@ -217,6 +219,7 @@ Endpoints "checkin_attention": false, "has_variations": false, "generate_tickets": null, + "allow_waitinglist": true, "show_quota_left": null, "require_approval": false, "require_bundling": false, @@ -306,6 +309,7 @@ Endpoints "hide_without_voucher": false, "allow_cancel": true, "generate_tickets": null, + "allow_waitinglist": true, "show_quota_left": null, "min_per_order": null, "max_per_order": null, @@ -380,6 +384,7 @@ Endpoints "hide_without_voucher": false, "allow_cancel": true, "generate_tickets": null, + "allow_waitinglist": true, "show_quota_left": null, "min_per_order": null, "max_per_order": null, @@ -443,6 +448,7 @@ Endpoints "min_per_order": null, "max_per_order": null, "generate_tickets": null, + "allow_waitinglist": true, "show_quota_left": null, "checkin_attention": false, "has_variations": true, @@ -533,6 +539,7 @@ Endpoints "require_voucher": false, "hide_without_voucher": false, "generate_tickets": null, + "allow_waitinglist": true, "show_quota_left": null, "allow_cancel": true, "min_per_order": null, diff --git a/src/pretix/api/serializers/item.py b/src/pretix/api/serializers/item.py index 187cdc1651..44e6c4a4f4 100644 --- a/src/pretix/api/serializers/item.py +++ b/src/pretix/api/serializers/item.py @@ -119,7 +119,7 @@ class ItemSerializer(I18nAwareModelSerializer): 'require_voucher', 'hide_without_voucher', 'allow_cancel', 'require_bundling', 'min_per_order', 'max_per_order', 'checkin_attention', 'has_variations', 'variations', 'addons', 'bundles', 'original_price', 'require_approval', 'generate_tickets', - 'show_quota_left', 'hidden_if_available') + 'show_quota_left', 'hidden_if_available', 'allow_waitinglist') read_only_fields = ('has_variations', 'picture') def get_serializer_context(self): diff --git a/src/pretix/base/migrations/0131_auto_20190729_1422.py b/src/pretix/base/migrations/0131_auto_20190729_1422.py new file mode 100644 index 0000000000..b4c3fc0529 --- /dev/null +++ b/src/pretix/base/migrations/0131_auto_20190729_1422.py @@ -0,0 +1,21 @@ +# Generated by Django 2.2.1 on 2019-07-29 14:22 + +import django.db.models.deletion +from django.db import migrations, models + +import pretix.base.models.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ('pretixbase', '0130_auto_20190729_1311'), + ] + + operations = [ + migrations.AddField( + model_name='item', + name='allow_waitinglist', + field=models.BooleanField(default=True), + ), + ] diff --git a/src/pretix/base/models/items.py b/src/pretix/base/models/items.py index ff60adc35b..b020221f53 100644 --- a/src/pretix/base/models/items.py +++ b/src/pretix/base/models/items.py @@ -311,6 +311,11 @@ class Item(LoggedModel): verbose_name=_("Generate tickets"), blank=True, null=True, ) + allow_waitinglist = models.BooleanField( + verbose_name=_("Show a waiting list for this ticket"), + help_text=_("This will only work of waiting lists are enabled for this event."), + default=True + ) show_quota_left = models.NullBooleanField( verbose_name=_("Show number of tickets left"), help_text=_("Publicly show how many tickets are still available."), diff --git a/src/pretix/control/forms/item.py b/src/pretix/control/forms/item.py index b977b174ce..18b3cae87f 100644 --- a/src/pretix/control/forms/item.py +++ b/src/pretix/control/forms/item.py @@ -437,6 +437,7 @@ class ItemUpdateForm(I18nModelForm): 'require_approval', 'hide_without_voucher', 'allow_cancel', + 'allow_waitinglist', 'max_per_order', 'min_per_order', 'checkin_attention', diff --git a/src/pretix/control/templates/pretixcontrol/item/index.html b/src/pretix/control/templates/pretixcontrol/item/index.html index 0dbe521e4b..eb366ae999 100644 --- a/src/pretix/control/templates/pretixcontrol/item/index.html +++ b/src/pretix/control/templates/pretixcontrol/item/index.html @@ -40,6 +40,7 @@ {% bootstrap_field form.hide_without_voucher layout="control" %} {% bootstrap_field form.require_bundling layout="control" %} {% bootstrap_field form.allow_cancel layout="control" %} + {% bootstrap_field form.allow_waitinglist layout="control" %} {% for v in formsets.values %}