From be100ce7ec5d92189f02078272d3a0ef90c38f30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 5 Mar 2023 22:58:08 +0800 Subject: [PATCH] Simplified the constructors of the period choosers. --- src/accounting/report/period_choosers.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/accounting/report/period_choosers.py b/src/accounting/report/period_choosers.py index f9bf8e2..561b117 100644 --- a/src/accounting/report/period_choosers.py +++ b/src/accounting/report/period_choosers.py @@ -109,8 +109,7 @@ class JournalPeriodChooser(PeriodChooser): """Constructs the journal period chooser.""" first: Transaction | None \ = Transaction.query.order_by(Transaction.date).first() - super(JournalPeriodChooser, self).__init__( - None if first is None else first.date) + super().__init__(None if first is None else first.date) def _url_for(self, period: Period) -> str: if period.is_default: @@ -129,8 +128,7 @@ class LedgerPeriodChooser(PeriodChooser): """The account.""" first: Transaction | None \ = Transaction.query.order_by(Transaction.date).first() - super(LedgerPeriodChooser, self).__init__( - None if first is None else first.date) + super().__init__(None if first is None else first.date) def _url_for(self, period: Period) -> str: if period.is_default: @@ -152,8 +150,7 @@ class IncomeExpensesPeriodChooser(PeriodChooser): """The account.""" first: Transaction | None \ = Transaction.query.order_by(Transaction.date).first() - super(IncomeExpensesPeriodChooser, self).__init__( - None if first is None else first.date) + super().__init__(None if first is None else first.date) def _url_for(self, period: Period) -> str: if period.is_default: