commit ad147216de4fd2a3fd7c4c4bec7e1b9b4c7a36c8
parent c00f880e78ea5954abc9177eb548cf029736185e
Author: MS <ms@taler.net>
Date: Mon, 7 Sep 2020 16:48:05 +0200
404 default page
Diffstat:
4 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/talermerchantdemos/blog/blog.py b/talermerchantdemos/blog/blog.py
@@ -272,3 +272,7 @@ def article(article_name, data=None):
"order_id", order_id, path=urllib.parse.quote(f"/essay/{article_name}")
)
return response
+
+@app.errorhandler(404)
+def handler(e):
+ return fallback_404(e)
diff --git a/talermerchantdemos/donations/donations.py b/talermerchantdemos/donations/donations.py
@@ -242,3 +242,7 @@ def fulfillment(receiver):
currency=CURRENCY,
)
return flask.redirect(pay_status["order_status_url"])
+
+@app.errorhandler(404)
+def handler(e):
+ return fallback_404(e)
diff --git a/talermerchantdemos/httpcommon/__init__.py b/talermerchantdemos/httpcommon/__init__.py
@@ -76,3 +76,6 @@ def backend_get(backend_url, endpoint, params):
status_code=resp.status_code
)
return response_json
+
+def fallback_404(error):
+ return "Page not found"
diff --git a/talermerchantdemos/survey/survey.py b/talermerchantdemos/survey/survey.py
@@ -135,3 +135,7 @@ def index():
return flask.render_template(
"templates/index.html", merchant_currency=CURRENCY
)
+
+@app.errorhandler(404)
+def handler(e):
+ return fallback_404(e)