From 8367fd14a8e6a0a7e5dac93c5ee3cb28f99429fd Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 10 Jan 2024 00:47:42 +0000 Subject: [PATCH] Prompt users to leave approval thread comment when re-submitting --- app/blueprints/packages/packages.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py index ab96e966..f477efd8 100644 --- a/app/blueprints/packages/packages.py +++ b/app/blueprints/packages/packages.py @@ -419,6 +419,7 @@ def move_to_state(package): flash(gettext("You don't have permission to do that"), "danger") return redirect(package.get_url("packages.view")) + old_state = package.state package.state = state msg = "Marked {} as {}".format(package.title, state.value) @@ -451,6 +452,10 @@ def move_to_state(package): return redirect(package.review_thread.get_view_url()) else: return redirect(url_for('threads.new', pid=package.id, title='Package approval comments')) + elif (package.review_thread and + old_state == PackageState.CHANGES_NEEDED and package.state == PackageState.READY_FOR_REVIEW): + flash(gettext("Please comment in the approval thread so editors know what you have changed"), "warning") + return redirect(package.review_thread.get_view_url()) return redirect(package.get_url("packages.view"))