Skip to content
Snippets Groups Projects
Commit 2ff468ef authored by Carlos Vega's avatar Carlos Vega
Browse files

make issue date field read only if the voucher is loaded on edit view

parent c7c1f10e
No related branches found
No related tags found
1 merge request!225Feature/custom voucher issue date
......@@ -80,6 +80,7 @@ class VoucherForm(ModelForm):
self.fields['expiry_date'].required = False
instance = getattr(self, 'instance', None)
if instance and instance.pk:
self.fields['issue_date'].widget.attrs['readonly'] = True
self.fields['voucher_type'].widget.attrs['readonly'] = True
self.fields['hours'].widget.attrs['readonly'] = True
self.fields['activity_type'].widget.attrs['readonly'] = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment