aboutsummaryrefslogtreecommitdiff
path: root/qc_app/__init__.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-07-02 10:54:12 -0500
committerFrederick Muriuki Muriithi2024-07-02 10:54:12 -0500
commitc67921a4b418eaf834d2e8ffe8c4dcd75e09c926 (patch)
tree9acbf52aee06ef780dcd2ce0d2adcc0faee4bed7 /qc_app/__init__.py
parent5568c4ee34d2539af7a6e880861dd90cca9fb78f (diff)
downloadgn-uploader-c67921a4b418eaf834d2e8ffe8c4dcd75e09c926.tar.gz
Add URL information to debug information
To help with error reporting, as the user to also provide the URL of the error page to help with debugging issues that the user encounters.
Diffstat (limited to 'qc_app/__init__.py')
-rw-r--r--qc_app/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/qc_app/__init__.py b/qc_app/__init__.py
index 9907695..3ee8aa0 100644
--- a/qc_app/__init__.py
+++ b/qc_app/__init__.py
@@ -3,7 +3,7 @@ import os
import logging
from pathlib import Path
-from flask import Flask
+from flask import Flask, request
from .entry import entrybp
from .upload import upload
@@ -33,6 +33,9 @@ def create_app():
if "QCAPP_SECRETS" in os.environ:
app.config.from_envvar("QCAPP_SECRETS")
+ # setup jinja2 symbols
+ app.jinja_env.globals.update(request_url=lambda : request.url)
+
# setup blueprints
app.register_blueprint(base, url_prefix="/")
app.register_blueprint(entrybp, url_prefix="/")