forum: properly redirect topic after changing forum

The URL changes so using the referrer is not much of an option.
This commit is contained in:
Lephe 2021-07-12 22:33:17 +02:00
parent 3551103c88
commit b9abfcfde7
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 5 additions and 1 deletions

View File

@ -79,7 +79,11 @@ def edit_post(postid):
for a, file in attachments:
a.set_file(file)
return redirect(referrer)
# Determine topic URL now, in case forum was changed
if isinstance(p, Topic):
return redirect(url_for('forum_topic', f=p.forum, page=(p,1)))
else:
return redirect(referrer)
# Non-submitted form
if isinstance(p, Comment):