From edbe17fcc9663d353e7e571a4ef54a129ed8066f Mon Sep 17 00:00:00 2001 From: Carlos Vega <carlos.vega@uni.lu> Date: Fri, 21 Jun 2019 14:57:30 +0200 Subject: [PATCH] added initial value (now) to issue_date field --- smash/web/forms/voucher_forms.py | 1 + 1 file changed, 1 insertion(+) diff --git a/smash/web/forms/voucher_forms.py b/smash/web/forms/voucher_forms.py index 926f45ba..9eaf8ee1 100644 --- a/smash/web/forms/voucher_forms.py +++ b/smash/web/forms/voucher_forms.py @@ -75,6 +75,7 @@ class VoucherForm(ModelForm): self.fields['issue_date'].widget.attrs.update({'placeholder': 'yyyy-mm-dd (optional)'}) 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() #expiry date self.fields['expiry_date'].widget.attrs['readonly'] = True self.fields['expiry_date'].required = False -- GitLab