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

@ -23,7 +23,7 @@ from flask import abort
from werkzeug.routing import BaseConverter
from accounting.models import Account
from accounting.report.period import Period
from .period import Period, get_period
from .utils.income_expense_account import IncomeExpensesAccount
@ -38,7 +38,7 @@ class PeriodConverter(BaseConverter):
:return: The corresponding period.
"""
try:
return Period.get_instance(value)
return get_period(value)
except ValueError:
abort(404)