Replaced the Period.get_instance method with the get_period function in the "accounting.report.period.parser" module. Changed the parse_spec function in the "accounting.report.period.parser" to private.

This commit is contained in:
2023-03-09 19:40:34 +08:00
parent 4432484acd
commit bc792c145f
6 changed files with 44 additions and 41 deletions

View File

@ -28,7 +28,7 @@ from flask_babel import LazyString
from accounting import db
from accounting.locale import gettext
from accounting.models import Currency, Account
from accounting.report.period import Period
from accounting.report.period import Period, get_period
from accounting.template_globals import default_currency_code
from .income_expense_account import IncomeExpensesAccount
from .option_link import OptionLink
@ -53,8 +53,7 @@ class ReportChooser:
"""
self.__active_report: ReportType = active_report
"""The currently active report."""
self.__period: Period = Period.get_instance() if period is None \
else period
self.__period: Period = get_period() if period is None else period
"""The period."""
self.__currency: Currency = db.session.get(
Currency, default_currency_code()) \