Allow for gt and gte selection of change_allow_user_price (#1746)

This commit is contained in:
Martin Gross
2020-08-07 11:54:27 +02:00
committed by GitHub
parent 7d9220ae3e
commit 750c3c5201
6 changed files with 118 additions and 4 deletions

View File

@@ -960,13 +960,14 @@ DEFAULTS = {
)
},
'change_allow_user_price': {
'default': 'gt',
'default': 'gte',
'type': str,
'form_class': forms.ChoiceField,
'serializer_class': serializers.ChoiceField,
'serializer_kwargs': dict(
choices=(
('gt', _('Only allow changes if the resulting price is higher or equal than the previous price.')),
('gte', _('Only allow changes if the resulting price is higher or equal than the previous price.')),
('gt', _('Only allow changes if the resulting price is higher than the previous price.')),
('eq', _('Only allow changes if the resulting price is equal to the previous price.')),
('any', _('Allow changes regardless of price, even if this results in a refund.')),
)
@@ -974,7 +975,8 @@ DEFAULTS = {
'form_kwargs': dict(
label=_("Requirement for changed prices"),
choices=(
('gt', _('Only allow changes if the resulting price is higher or equal than the previous price.')),
('gte', _('Only allow changes if the resulting price is higher or equal than the previous price.')),
('gt', _('Only allow changes if the resulting price is higher than the previous price.')),
('eq', _('Only allow changes if the resulting price is equal to the previous price.')),
('any', _('Allow changes regardless of price, even if this results in a refund.')),
),