mirror of
https://github.com/pretix/pretix.git
synced 2026-08-06 10:07:50 +00:00
Add typeahead suggestions for voucher tag field (#6058)
Suggest existing tags as the user types in the voucher tag field. Waiting list voucher tags are excluded from suggestions.
This commit is contained in:
@@ -106,6 +106,11 @@ class VoucherForm(I18nModelForm):
|
||||
pass
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.fields['tag'].widget.attrs['data-typeahead-url'] = reverse('control:event.vouchers.tags.typeahead', kwargs={
|
||||
'event': instance.event.slug,
|
||||
'organizer': instance.event.organizer.slug,
|
||||
})
|
||||
|
||||
if instance.event.has_subevents:
|
||||
self.fields['subevent'].queryset = instance.event.subevents.all()
|
||||
self.fields['subevent'].widget = Select2(
|
||||
|
||||
Reference in New Issue
Block a user