Removed the redundant Flask App context from the default_currency_code Jinja2 global and the default_ie_account_code function. They are always under the Flask app context.
This commit is contained in:
		| @@ -71,9 +71,8 @@ def default_ie_account_code() -> str: | ||||
|  | ||||
|     :return: The default account code for the income and expenses log. | ||||
|     """ | ||||
|     with current_app.app_context(): | ||||
|         return current_app.config.get("ACCOUNTING_DEFAULT_IE_ACCOUNT", | ||||
|                                       Account.CASH_CODE) | ||||
|     return current_app.config.get("ACCOUNTING_DEFAULT_IE_ACCOUNT", | ||||
|                                   Account.CASH_CODE) | ||||
|  | ||||
|  | ||||
| def default_ie_account() -> IncomeExpensesAccount: | ||||
|   | ||||
| @@ -35,5 +35,4 @@ def default_currency_code() -> str: | ||||
|  | ||||
|     :return: The default currency code. | ||||
|     """ | ||||
|     with current_app.app_context(): | ||||
|         return current_app.config.get("ACCOUNTING_DEFAULT_CURRENCY", "USD") | ||||
|     return current_app.config.get("ACCOUNTING_DEFAULT_CURRENCY", "USD") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user