From 71a20cba2994bd111e0022ff994131ea858aee66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sat, 8 Apr 2023 07:31:28 +0800 Subject: [PATCH] Replaced the "default_currency_text" pseudo property with the "default_currency" pseudo property in the Options class. --- src/accounting/templates/accounting/option/detail.html | 2 +- src/accounting/utils/options.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/accounting/templates/accounting/option/detail.html b/src/accounting/templates/accounting/option/detail.html index e8f7db5..f73b986 100644 --- a/src/accounting/templates/accounting/option/detail.html +++ b/src/accounting/templates/accounting/option/detail.html @@ -42,7 +42,7 @@ First written: 2023/3/22 {{ A_("Default Currency") }} - {{ obj.default_currency_text }} + {{ obj.default_currency }} {{ A_("Default Account for the Income and Expenses Log") }} diff --git a/src/accounting/utils/options.py b/src/accounting/utils/options.py index b165594..d2c60ea 100644 --- a/src/accounting/utils/options.py +++ b/src/accounting/utils/options.py @@ -99,12 +99,12 @@ class Options: self.__set_option("default_currency_code", value) @property - def default_currency_text(self) -> str: + def default_currency(self) -> Currency: """Returns the text of the default currency code. :return: The text of the default currency code. """ - return str(db.session.get(Currency, self.default_currency_code)) + return db.session.get(Currency, self.default_currency_code) @property def default_ie_account_code(self) -> str: