From 38358cafe41b2b5fe0bbece62ef6eb7367ef8b90 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Jun 2022 04:34:15 +0200 Subject: [PATCH] make publishing a draft reload the page instead of going to the post --- files/routes/posts.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/routes/posts.py b/files/routes/posts.py index a287af60f..f0b075b86 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -90,6 +90,9 @@ def publish(pid, v): send_discord_message(post.permalink) cache.delete_memoized(changeloglist) + if request.referrer and request.referrer.startswith(f'{SITE_FULL}/'): + return redirect(request.referrer) + return redirect(post.permalink) @app.get("/submit")