aboutsummaryrefslogtreecommitdiffstats
path: root/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'app.py')
-rwxr-xr-xapp.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/app.py b/app.py
index 75558f8..7847914 100755
--- a/app.py
+++ b/app.py
@@ -113,11 +113,15 @@ def get_thought():
thought_id = flask.request.args.get("id", type=int)
with database.Database() as db:
try:
- category_name, title, dt, parsed, headers = parser.get_thought_from_id(db, thought_id)
+ category_name, title, dt, parsed, headers, redirect = parser.get_thought_from_id(db, thought_id)
# print(headers)
except TypeError:
flask.abort(404)
return
+
+ if redirect is not None:
+ return flask.redirect(redirect, code = 301)
+
return flask.render_template(
"thought.html.j2",
**get_template_items(title, db),