From 56ed2f9bcf28e4c180938209db7784c810372bf7 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Fri, 1 Jun 2018 16:04:41 +0200 Subject: [PATCH] voucher will expiry after 90 days --- smash/web/forms/voucher_forms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smash/web/forms/voucher_forms.py b/smash/web/forms/voucher_forms.py index defa1698..efb1c590 100644 --- a/smash/web/forms/voucher_forms.py +++ b/smash/web/forms/voucher_forms.py @@ -66,7 +66,7 @@ class VoucherForm(ModelForm): instance = super(VoucherForm, self).save(commit=False) if not instance.id: instance.issue_date = timezone.now() - instance.expiry_date = instance.issue_date + datetime.timedelta(days=92) + instance.expiry_date = instance.issue_date + datetime.timedelta(days=90) max_id = str(1).zfill(5) if Voucher.objects.all().count() > 0: max_id = str(Voucher.objects.latest('id').id + 1).zfill(5) -- GitLab