diff --git a/src/pretix/api/serializers/item.py b/src/pretix/api/serializers/item.py index 08a83f8cf..fdf6f8100 100644 --- a/src/pretix/api/serializers/item.py +++ b/src/pretix/api/serializers/item.py @@ -363,6 +363,11 @@ class ItemSerializer(SalesChannelMigrationMixin, I18nAwareModelSerializer): "Gift card products should not be admission products at the same time." )) + if data.get('free_price_suggestion') and data.get('free_price_suggestion') < data.get('default_price'): + raise ValidationError(_( + "Your price suggestion cannot be less than the default price. " + )) + return data def validate_category(self, value): diff --git a/src/pretix/control/forms/item.py b/src/pretix/control/forms/item.py index b90592ffb..0d9740f1b 100644 --- a/src/pretix/control/forms/item.py +++ b/src/pretix/control/forms/item.py @@ -889,6 +889,9 @@ class ItemUpdateForm(I18nModelForm): Item.clean_media_settings(self.event, d.get('media_policy'), d.get('media_type'), d.get('issue_giftcard')) + if d.get('free_price_suggestion') and d.get('free_price_suggestion') < d.get('default_price'): + self.add_error('free_price_suggestion', _("Your price suggestion cannot be less than the default price. ")) + return d class Meta: @@ -1126,6 +1129,14 @@ class ItemVariationForm(I18nModelForm): "If a valid membership is required, at least one valid membership type needs to be selected." ) ) + + if ( + d.get('free_price_suggestion') + and d.get('default_price') + and d.get('free_price_suggestion') < d.get('default_price') + ): + self.add_error('free_price_suggestion', _("Your price suggestion cannot be less than the default price. ")) + return d def save(self, commit=True):