diff --git a/src/accounting/utils/next_uri.py b/src/accounting/utils/next_uri.py
index bbc5813..c58a216 100644
--- a/src/accounting/utils/next_uri.py
+++ b/src/accounting/utils/next_uri.py
@@ -26,6 +26,15 @@ from flask import request, Blueprint, current_app
from itsdangerous import URLSafeSerializer, BadData
+def __as_next() -> str:
+ """Encodes the current request URI as value for the next URI.
+
+ :return: The current request URI as value for the next URI.
+ """
+ return encode_next(
+ request.full_path if request.query_string else request.path)
+
+
def append_next(uri: str) -> str:
"""Appends the current URI as the next URI to the query argument.
@@ -104,6 +113,7 @@ def init_app(bp: Blueprint) -> None:
:param bp: The blueprint of the accounting application.
:return: None.
"""
+ bp.add_app_template_global(__as_next, "accounting_as_next")
bp.add_app_template_filter(append_next, "accounting_append_next")
bp.add_app_template_filter(inherit_next, "accounting_inherit_next")
bp.add_app_template_filter(or_next, "accounting_or_next")
diff --git a/tests/test_site/__init__.py b/tests/test_site/__init__.py
index 9e24dc5..a036247 100644
--- a/tests/test_site/__init__.py
+++ b/tests/test_site/__init__.py
@@ -68,7 +68,6 @@ def create_app(is_testing: bool = False) -> Flask:
db.init_app(app)
app.register_blueprint(bp, url_prefix="/")
- app.add_template_global(__as_next, "accounting_as_next")
from . import locale
locale.init_app(app)
@@ -149,12 +148,3 @@ def get_home() -> str:
:return: The home page.
"""
return render_template("home.html")
-
-
-def __as_next() -> str:
- """Encodes the current request URI as value for the next URI.
-
- :return: The current request URI as value for the next URI.
- """
- return encode_next(
- request.full_path if request.query_string else request.path)