From f5b0454e9f5a6ec76ad2522541bb639d839be8e9 Mon Sep 17 00:00:00 2001 From: Martin Gross Date: Mon, 28 Jul 2025 18:22:39 +0200 Subject: [PATCH] API/Quotas: Expose "ignore_for_event_availability" (Z#23202218) (#5324) --- doc/api/resources/quotas.rst | 17 ++++++++++++----- src/pretix/api/serializers/item.py | 2 +- src/tests/api/test_items.py | 3 ++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/api/resources/quotas.rst b/doc/api/resources/quotas.rst index 87a985e18..fa0623e3e 100644 --- a/doc/api/resources/quotas.rst +++ b/doc/api/resources/quotas.rst @@ -28,6 +28,8 @@ closed boolean Whether the quo field). release_after_exit boolean Whether the quota regains capacity as soon as some tickets have been scanned at an exit. +ignore_for_event_availability boolean Whether the quota is ignored when calculating the event's + availability of tickets. available boolean Whether this quota is available. Only returned if ``with_availability=true`` is set on the request. Do not rely on this value for critical operations, it may be slightly out of date. @@ -72,7 +74,8 @@ Endpoints "variations": [1, 4, 5, 7], "subevent": null, "close_when_sold_out": false, - "closed": false + "closed": false, + "ignore_for_event_availability": false } ] } @@ -118,7 +121,8 @@ Endpoints "variations": [1, 4, 5, 7], "subevent": null, "close_when_sold_out": false, - "closed": false + "closed": false, + "ignore_for_event_availability": false } :param organizer: The ``slug`` field of the organizer to fetch @@ -149,7 +153,8 @@ Endpoints "variations": [1, 4, 5, 7], "subevent": null, "close_when_sold_out": false, - "closed": false + "closed": false, + "ignore_for_event_availability": false } **Example response**: @@ -168,7 +173,8 @@ Endpoints "variations": [1, 4, 5, 7], "subevent": null, "close_when_sold_out": false, - "closed": false + "closed": false, + "ignore_for_event_availability": false } :param organizer: The ``slug`` field of the organizer of the event/item to create a quota for @@ -223,7 +229,8 @@ Endpoints ], "subevent": null, "close_when_sold_out": false, - "closed": false + "closed": false, + "ignore_for_event_availability": false } :param organizer: The ``slug`` field of the organizer to modify diff --git a/src/pretix/api/serializers/item.py b/src/pretix/api/serializers/item.py index d565abb55..1c40eb13c 100644 --- a/src/pretix/api/serializers/item.py +++ b/src/pretix/api/serializers/item.py @@ -582,7 +582,7 @@ class QuotaSerializer(I18nAwareModelSerializer): class Meta: model = Quota fields = ('id', 'name', 'size', 'items', 'variations', 'subevent', 'closed', 'close_when_sold_out', - 'release_after_exit', 'available', 'available_number') + 'release_after_exit', 'available', 'available_number', 'ignore_for_event_availability') def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/src/tests/api/test_items.py b/src/tests/api/test_items.py index 23475259c..4b011a4c9 100644 --- a/src/tests/api/test_items.py +++ b/src/tests/api/test_items.py @@ -1896,7 +1896,8 @@ TEST_QUOTA_RES = { "subevent": None, "close_when_sold_out": False, "release_after_exit": False, - "closed": False + "closed": False, + "ignore_for_event_availability": False, }