From 5b2fda1a6e4176d51dff886cd0fb1ab96797366b Mon Sep 17 00:00:00 2001 From: Leigh Morresi <275001+dgtlmoon@users.noreply.github.com> Date: Mon, 1 Mar 2021 14:33:25 +0100 Subject: [PATCH] Fix import form flow logic --- backend/__init__.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/backend/__init__.py b/backend/__init__.py index 246fdc9d2..067442028 100644 --- a/backend/__init__.py +++ b/backend/__init__.py @@ -318,14 +318,15 @@ def changedetection_app(config=None, datastore_o=None): messages.append({'class': 'ok', 'message': "{} Imported, {} Skipped.".format(good, len(remaining_urls))}) if len(remaining_urls) == 0: + # Looking good, redirect to index. return redirect(url_for('index')) - # @todo repair - else: - output = render_template("import.html", - messages=messages, - remaining="\n".join(remaining_urls) - ) - messages = [] + + # Could be some remaining, or we could be on GET + output = render_template("import.html", + messages=messages, + remaining="\n".join(remaining_urls) + ) + messages = [] return output