Removed a redundant test in the _parse_period_spec function in the "accounting.report.period" module.

This commit is contained in:
依瑪貓 2023-03-08 21:37:26 +08:00
parent 4f7f87b10d
commit ba3d8c6d4e

View File

@ -563,9 +563,6 @@ def _parse_period_spec(text: str) \
may be None. may be None.
:raise ValueError: When the date is invalid. :raise ValueError: When the date is invalid.
""" """
if text == "this-month":
today: datetime.date = datetime.date.today()
return datetime.date(today.year, today.month, 1), _month_end(today)
if text == "-": if text == "-":
return None, None return None, None
m = re.match(r"^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$", text) m = re.match(r"^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$", text)