From 076f279a6023eef4a206f31793de05511753c0de Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Thu, 16 Feb 2023 14:45:18 +0100 Subject: [PATCH] Fix voucher item validation --- src/pretix/base/models/vouchers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pretix/base/models/vouchers.py b/src/pretix/base/models/vouchers.py index b22a3f76b7..f44b720434 100644 --- a/src/pretix/base/models/vouchers.py +++ b/src/pretix/base/models/vouchers.py @@ -331,7 +331,7 @@ class Voucher(LoggedModel): if item: raise ValidationError(_('You cannot select a quota and a specific product at the same time.')) elif item: - if item.require_bundling or item.category.is_addon: + if item.require_bundling or (item.category_id and item.category.is_addon): raise ValidationError(_('You cannot select a product that is only available as an add-on product or ' 'as part of a bundle, since vouchers cannot be applied to add-on products or ' 'bundled products.'))