From 81c954e66255cba586f57b1551c586c69251e6a9 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Mon, 22 Jan 2018 07:49:17 +0100 Subject: [PATCH] Display default today date in new refund page --- refunding/forms.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/refunding/forms.py b/refunding/forms.py index 23a446c..71b4de7 100644 --- a/refunding/forms.py +++ b/refunding/forms.py @@ -1,3 +1,5 @@ +import datetime + from bootstrap3_datetime.widgets import DateTimePicker from django import forms from django.db.models import Q @@ -19,6 +21,7 @@ class RefundForm(forms.ModelForm): .objects\ .filter(Q(refund=None) | Q(refund=self.instance))\ .order_by('-date') + self.fields['date'].initial = datetime.date.today() def save(self, *args, **kwargs): # Save the refund