diff --git a/smash/web/forms/voucher_forms.py b/smash/web/forms/voucher_forms.py index 946486db177dd364d547e97afba6b33fafbc9bc2..7067d0d9d83ce82ae24d88a0d072ab66faa6944a 100644 --- a/smash/web/forms/voucher_forms.py +++ b/smash/web/forms/voucher_forms.py @@ -56,6 +56,9 @@ class VoucherForm(ModelForm): instance = getattr(self, 'instance', None) if instance and instance.pk: self.fields['voucher_type'].widget.attrs['readonly'] = True + self.fields['usage_partner'].queryset = Worker.get_workers_by_worker_type(WORKER_VOUCHER_PARTNER).filter( + voucher_types = instance.voucher_type) + if instance.status != VOUCHER_STATUS_NEW: self.fields['status'].widget.attrs['readonly'] = True self.fields['feedback'].widget.attrs['readonly'] = True