From 18eaf4477e354b763c8b83bcfae0508f89842979 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sat, 8 Aug 2020 15:30:33 +0200 Subject: [PATCH] :bug: timezone.now is a DateTime, not a Date --- apps/member/forms.py | 4 ++-- apps/member/models.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/member/forms.py b/apps/member/forms.py index 2934bbee..5c211b4d 100644 --- a/apps/member/forms.py +++ b/apps/member/forms.py @@ -39,7 +39,7 @@ class ProfileForm(forms.ModelForm): """ report_frequency = forms.IntegerField(required=False, initial=0, label=_("Report frequency")) - last_report = forms.DateField(required=False, disabled=True, label=_("Last report date")) + last_report = forms.DateTimeField(required=False, disabled=True, label=_("Last report date")) def save(self, commit=True): if not self.instance.section or (("department" in self.changed_data @@ -50,7 +50,7 @@ class ProfileForm(forms.ModelForm): class Meta: model = Profile fields = '__all__' - exclude = ('user', 'email_confirmed', 'registration_valid', ) + exclude = ('user', ) class ClubForm(forms.ModelForm): diff --git a/apps/member/models.py b/apps/member/models.py index 4e930202..29174732 100644 --- a/apps/member/models.py +++ b/apps/member/models.py @@ -97,7 +97,7 @@ class Profile(models.Model): default=0, ) - last_report = models.DateField( + last_report = models.DateTimeField( verbose_name=_("last report date"), default=timezone.now, )