Commit 82ca9d8772627038e839561e3dd5f389d0f0384d
1 parent
a81d9d51
Exists in
master
and in
3 other branches
Adjusting actual date verification on pendencies
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
pendencies/forms.py
... | ... | @@ -56,7 +56,7 @@ class PendenciesForm(forms.ModelForm): |
56 | 56 | subject = Subject.objects.get(id = subject_id) |
57 | 57 | |
58 | 58 | if not begin_date == ValueError and begin_date: |
59 | - if not pend_id and begin_date.date() < datetime.datetime.today().date(): | |
59 | + if not self.instance.id and begin_date.date() < datetime.datetime.today().date(): | |
60 | 60 | self.add_error('begin_date', _("This input should be filled with a date equal or after today's date.")) |
61 | 61 | |
62 | 62 | if begin_date.date() < subject.init_date: |
... | ... | @@ -66,7 +66,7 @@ class PendenciesForm(forms.ModelForm): |
66 | 66 | self.add_error('begin_date', _('This input should be filled with a date equal or after the subject end date.')) |
67 | 67 | |
68 | 68 | if not end_date == ValueError and end_date: |
69 | - if not pend_id and end_date.date() < datetime.datetime.today().date(): | |
69 | + if not self.instance.id and end_date.date() < datetime.datetime.today().date(): | |
70 | 70 | self.add_error('end_date', _("This input should be filled with a date equal or after today's date.")) |
71 | 71 | |
72 | 72 | if end_date.date() < subject.init_date: | ... | ... |