rewriting redirects

This commit is contained in:
manetta 2022-03-11 17:52:25 +01:00
parent 4bb1c14abe
commit f7105a30bf

View File

@ -108,13 +108,13 @@ def index():
exts = ['.md', '.css'] exts = ['.md', '.css']
for ext in exts: for ext in exts:
create_pad_on_first_run(name, ext) create_pad_on_first_run(name, ext)
return redirect(url_for('pad', name=name)) return redirect(f'{ APP.config["APPLICATION_ROOT"] }{ name }/pad/')
else: else:
return render_template('start.html', application_root=APP.config["APPLICATION_ROOT"]) return render_template('start.html', application_root=APP.config["APPLICATION_ROOT"])
@APP.route('/<name>/') @APP.route('/<name>/')
def main(name): def main(name):
return redirect(url_for('pad', name=name)) return redirect(f'{ APP.config["APPLICATION_ROOT"] }{ name }/pad/')
@APP.route('/<name>/pad/') @APP.route('/<name>/pad/')
def pad(name): def pad(name):