Determine the start of the financial only for wrapping years.

If the financial year is from Jan to Dec there we do not need to
determine the start to see which year it falls into.
This commit is contained in:
David Martin 2017-08-26 19:50:57 +10:00
parent 82852cc01e
commit a0c054a5f6

View File

@ -63,9 +63,9 @@ class FinancialYearFilter(admin.SimpleListFilter):
def _determine_fy(self, date): def _determine_fy(self, date):
"""Return a (query, display) financial year tuple of the given date.""" """Return a (query, display) financial year tuple of the given date."""
fy_start = self._fy_start(date.year)
if self._fy_does_wrap(): if self._fy_does_wrap():
fy_start = self._fy_start(date.year)
if date.date() >= fy_start: if date.date() >= fy_start:
query = "{}-{}".format(date.year, date.year + 1) query = "{}-{}".format(date.year, date.year + 1)
else: else: