Fix unassign from device detail redirecting to dashboard
Pass a 'next' hidden field from the device detail unassign form so the route redirects back to the device page instead of the dashboard.
This commit is contained in:
@@ -205,7 +205,8 @@ def create_app(config_object="config"):
|
||||
battery.device_id = None
|
||||
db.commit()
|
||||
flash(f"{battery.label} unassigned and marked available.", "success")
|
||||
return redirect(url_for("dashboard"))
|
||||
next_url = request.form.get("next", "")
|
||||
return redirect(next_url if next_url.startswith("/") else url_for("dashboard"))
|
||||
|
||||
# ------------------------------------------------------------------ #
|
||||
# Battery — retire
|
||||
|
||||
Reference in New Issue
Block a user