Copypaste fail from moving logic out to turn a date to a string ('value' -> 'dt)

(badges.py)
This commit is contained in:
jesopo 2018-12-22 09:35:11 +00:00
parent 13cf49ac5d
commit 7223e76e24

View file

@ -15,10 +15,10 @@ class Module(ModuleManager.BaseModule):
return datetime.datetime.strptime(dt, DATETIME_FORMAT)
def _parse_date(self, dt: str):
if value.lower() == "today":
if dt.lower() == "today":
return self._now()
else:
match = RE_HUMAN_FORMAT.match(value)
match = RE_HUMAN_FORMAT.match(dt)
if not match:
raise utils.EventError("Invalid date format, please use %s" %
HUMAN_FORMAT_HELP)