Author: Pedro Lucas Porcellis <pedrolucasporcellis@gmail.com>
Redirect instead of rendering on the same route
core/blueprints/basic.py | 4 ++--
diff --git a/core/blueprints/basic.py b/core/blueprints/basic.py index 9f4375fd32911f582673960d12df63e8326e729e..37a0fa7cbe2a94e2ec52846c1fee74ef54204688 100644 --- a/core/blueprints/basic.py +++ b/core/blueprints/basic.py @@ -1,4 +1,4 @@ -from flask import Blueprint, render_template, request, abort, Response +from flask import Blueprint, render_template, request, abort, Response, redirect, url_for from core.database import db from core.types.document import Document from hashlib import sha1 @@ -56,4 +56,4 @@ db.add(doc) db.commit() db.flush() - return render_template('preview.html', doc = doc) + return redirect(url_for('basic.show', sha = doc.sha))