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

prevent voucher from being set to a duration with negative hours (#502)

parent 21497d57
No related branches found
No related tags found
1 merge request!436Fix/513 - change import on export
......@@ -76,6 +76,8 @@ class VoucherForm(ModelForm):
self.fields['issue_date'].widget.attrs.update({'pattern': '[0-9]{4}-[0-9]{2}-[0-9]{2}'})
self.fields['issue_date'].widget.attrs.update({'required': False})
self.fields['issue_date'].initial = timezone.now()
#hours
self.fields['hours'].widget.attrs.update({'min': 0})
# expiry date
self.fields['expiry_date'].widget.attrs['readonly'] = True
self.fields['expiry_date'].required = False
......
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