forked from CGM_Public/pretix_original
Use internal name of product in filter forms
This commit is contained in:
@@ -1859,11 +1859,11 @@ class VoucherFilterForm(FilterForm):
|
|||||||
for i in self.event.items.prefetch_related('variations').all():
|
for i in self.event.items.prefetch_related('variations').all():
|
||||||
variations = list(i.variations.all())
|
variations = list(i.variations.all())
|
||||||
if variations:
|
if variations:
|
||||||
choices.append((str(i.pk), _('{product} – Any variation').format(product=i.name)))
|
choices.append((str(i.pk), _('{product} – Any variation').format(product=str(i))))
|
||||||
for v in variations:
|
for v in variations:
|
||||||
choices.append(('%d-%d' % (i.pk, v.pk), '%s – %s' % (i.name, v.value)))
|
choices.append(('%d-%d' % (i.pk, v.pk), '%s – %s' % (str(i), v.value)))
|
||||||
else:
|
else:
|
||||||
choices.append((str(i.pk), i.name))
|
choices.append((str(i.pk), str(i)))
|
||||||
for q in self.event.quotas.all():
|
for q in self.event.quotas.all():
|
||||||
choices.append(('q-%d' % q.pk, _('Any product in quota "{quota}"').format(quota=q)))
|
choices.append(('q-%d' % q.pk, _('Any product in quota "{quota}"').format(quota=q)))
|
||||||
self.fields['itemvar'].choices = choices
|
self.fields['itemvar'].choices = choices
|
||||||
@@ -2141,11 +2141,11 @@ class CheckinFilterForm(FilterForm):
|
|||||||
for i in self.event.items.prefetch_related('variations').all():
|
for i in self.event.items.prefetch_related('variations').all():
|
||||||
variations = list(i.variations.all())
|
variations = list(i.variations.all())
|
||||||
if variations:
|
if variations:
|
||||||
choices.append((str(i.pk), _('{product} – Any variation').format(product=i.name)))
|
choices.append((str(i.pk), _('{product} – Any variation').format(product=str(i))))
|
||||||
for v in variations:
|
for v in variations:
|
||||||
choices.append(('%d-%d' % (i.pk, v.pk), '%s – %s' % (i.name, v.value)))
|
choices.append(('%d-%d' % (i.pk, v.pk), '%s – %s' % (str(i), v.value)))
|
||||||
else:
|
else:
|
||||||
choices.append((str(i.pk), i.name))
|
choices.append((str(i.pk), str(i)))
|
||||||
self.fields['itemvar'].choices = choices
|
self.fields['itemvar'].choices = choices
|
||||||
|
|
||||||
def filter_qs(self, qs):
|
def filter_qs(self, qs):
|
||||||
|
|||||||
Reference in New Issue
Block a user