# 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:
@@ -9,6 +9,7 @@ from dal import autocomplete
|
||||
from django import forms
|
||||
|
||||
from konova.forms.base_form import BaseForm
|
||||
from konova.utils import validators
|
||||
from konova.utils.message_templates import EDITED_GENERAL_DATA
|
||||
from user.models import User
|
||||
from django.db import transaction
|
||||
@@ -175,6 +176,7 @@ class NewInterventionForm(BaseForm):
|
||||
label=_("Registration date"),
|
||||
label_suffix=_(""),
|
||||
required=False,
|
||||
validators=[validators.reasonable_date],
|
||||
widget=forms.DateInput(
|
||||
attrs={
|
||||
"type": "date",
|
||||
@@ -187,6 +189,7 @@ class NewInterventionForm(BaseForm):
|
||||
label=_("Binding on"),
|
||||
label_suffix=_(""),
|
||||
required=False,
|
||||
validators=[validators.reasonable_date],
|
||||
widget=forms.DateInput(
|
||||
attrs={
|
||||
"type": "date",
|
||||
|
||||
Reference in New Issue
Block a user