# 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:
@@ -11,6 +11,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from intervention.models import RevocationDocument
|
||||
from konova.forms.modals import BaseModalForm, RemoveModalForm
|
||||
from konova.utils import validators
|
||||
from konova.utils.message_templates import REVOCATION_ADDED, REVOCATION_EDITED
|
||||
|
||||
|
||||
@@ -19,6 +20,7 @@ class NewRevocationModalForm(BaseModalForm):
|
||||
label=_("Date"),
|
||||
label_suffix=_(""),
|
||||
help_text=_("Date of revocation"),
|
||||
validators=[validators.reasonable_date],
|
||||
widget=forms.DateInput(
|
||||
attrs={
|
||||
"type": "date",
|
||||
|
||||
Reference in New Issue
Block a user