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:
Kian Cross
2026-07-06 11:42:05 +02:00
committed by GitHub
parent ddbea7c32e
commit 6fdcbcebd2
4 changed files with 57 additions and 1 deletions
+5
View File
@@ -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(