validatorfuncs.future must create utcnow() time-aware so comparison with generated datetime can be done.
This commit is contained in:
parent
0244518aac
commit
7f14d3a167
2 changed files with 12 additions and 12 deletions
|
|
@ -121,7 +121,7 @@ def duration(entry, option_key="Duration", **kwargs):
|
|||
|
||||
def future(entry, option_key="Future Datetime", from_tz=None, **kwargs):
|
||||
time = datetime(entry, option_key, from_tz=from_tz)
|
||||
if time < _dt.datetime.utcnow():
|
||||
if time < _dt.datetime.utcnow().replace(tzinfo=_dt.timezone.utc):
|
||||
raise ValueError(f"That {option_key} is in the past! Must give a Future datetime!")
|
||||
return time
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue