date range validator should not try to evaluate empty dates
This commit is contained in:
parent
dab5fe83fc
commit
a7ef93dad4
@ -6,6 +6,9 @@ from datetime import datetime
|
|||||||
|
|
||||||
def DateRange(lower_bound=None, upper_bound=None, message=None):
|
def DateRange(lower_bound=None, upper_bound=None, message=None):
|
||||||
def _date_range(form, field):
|
def _date_range(form, field):
|
||||||
|
if field.data is None:
|
||||||
|
return
|
||||||
|
|
||||||
now = pendulum.now().date()
|
now = pendulum.now().date()
|
||||||
|
|
||||||
if isinstance(field.data, str):
|
if isinstance(field.data, str):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user