# Improves form date checking
* adds validator to make sure no dates like `01.01.1` can be accepted. All dates must be somewhat later than 01.01.1950
This commit is contained in:
@@ -15,6 +15,7 @@ from compensation.models import EcoAccount
|
||||
from intervention.models import Handler, Responsibility, Legal
|
||||
from konova.forms import SimpleGeomForm
|
||||
from konova.forms.modals import RemoveModalForm
|
||||
from konova.utils import validators
|
||||
from user.models import User, UserActionLogEntry
|
||||
|
||||
|
||||
@@ -43,6 +44,7 @@ class NewEcoAccountForm(AbstractCompensationForm, CompensationResponsibleFormMix
|
||||
label_suffix="",
|
||||
help_text=_("When did the parties agree on this?"),
|
||||
required=False,
|
||||
validators=[validators.reasonable_date],
|
||||
widget=forms.DateInput(
|
||||
attrs={
|
||||
"type": "date",
|
||||
|
||||
@@ -10,6 +10,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from konova.forms.modals import BaseModalForm
|
||||
from konova.models import DeadlineType
|
||||
from konova.utils import validators
|
||||
from konova.utils.message_templates import DEADLINE_EDITED
|
||||
|
||||
|
||||
@@ -34,6 +35,7 @@ class NewDeadlineModalForm(BaseModalForm):
|
||||
label_suffix="",
|
||||
required=True,
|
||||
help_text=_("Select date"),
|
||||
validators=[validators.reasonable_date],
|
||||
widget=forms.DateInput(
|
||||
attrs={
|
||||
"type": "date",
|
||||
|
||||
@@ -9,6 +9,7 @@ from django import forms
|
||||
from django.utils.translation import pgettext_lazy as _con, gettext_lazy as _
|
||||
|
||||
from konova.forms.modals import RemoveModalForm, BaseModalForm
|
||||
from konova.utils import validators
|
||||
from konova.utils.message_templates import PAYMENT_EDITED
|
||||
|
||||
|
||||
@@ -33,6 +34,7 @@ class NewPaymentForm(BaseModalForm):
|
||||
label=_("Due on"),
|
||||
label_suffix=_(""),
|
||||
required=False,
|
||||
validators=[validators.reasonable_date],
|
||||
help_text=_("Due on which date"),
|
||||
widget=forms.DateInput(
|
||||
attrs={
|
||||
|
||||
Reference in New Issue
Block a user