Redirect to oauth_start if not logged in.

This commit is contained in:
Edward Betts 2023-12-06 09:53:35 +00:00
parent 39f9ba31ed
commit 128d84fce9

View file

@ -266,7 +266,10 @@ def article_page(url_title: str) -> str | Response:
if flask.request.method == "POST": if flask.request.method == "POST":
hit_title = flask.request.form["hit"] hit_title = flask.request.form["hit"]
try:
do_save(from_title, hit_title) do_save(from_title, hit_title)
except wikidata_oauth.LoginNeeded:
return flask.redirect(flask.url_for("start_oauth"))
return flask.redirect( return flask.redirect(
flask.url_for("article_page", url_title=url_title, after=hit_title) flask.url_for("article_page", url_title=url_title, after=hit_title)
) )