Fix error on double "move_to_state" submission
This commit is contained in:
@@ -400,6 +400,9 @@ def move_to_state(package):
|
|||||||
if state is None:
|
if state is None:
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
|
if package.state == state:
|
||||||
|
return redirect(package.get_url("packages.view"))
|
||||||
|
|
||||||
if not can_move_to_state(package, current_user, state):
|
if not can_move_to_state(package, current_user, state):
|
||||||
flash(gettext("You don't have permission to do that"), "danger")
|
flash(gettext("You don't have permission to do that"), "danger")
|
||||||
return redirect(package.get_url("packages.view"))
|
return redirect(package.get_url("packages.view"))
|
||||||
|
|||||||
Reference in New Issue
Block a user