Skip to content
Snippets Groups Projects
Unverified Commit 7396a254 authored by Claire's avatar Claire Committed by GitHub
Browse files

Fix empty batch statuses selection causing a 500 error (#17532)

* Fix empty batch statuses selection causing a 500 error

* Simplify current_params
parent 38845592
No related branches found
No related tags found
No related merge requests found
...@@ -29,8 +29,9 @@ module Admin ...@@ -29,8 +29,9 @@ module Admin
end end
def after_create_redirect_path def after_create_redirect_path
if @status_batch_action.report_id.present? report_id = @status_batch_action&.report_id || params[:report_id]
admin_report_path(@status_batch_action.report_id) if report_id.present?
admin_report_path(report_id)
else else
admin_account_statuses_path(params[:account_id], current_params) admin_account_statuses_path(params[:account_id], current_params)
end end
...@@ -48,6 +49,10 @@ module Admin ...@@ -48,6 +49,10 @@ module Admin
params.slice(*Admin::StatusFilter::KEYS).permit(*Admin::StatusFilter::KEYS) params.slice(*Admin::StatusFilter::KEYS).permit(*Admin::StatusFilter::KEYS)
end end
def current_params
params.slice(:media, :page).permit(:media, :page)
end
def action_from_button def action_from_button
if params[:report] if params[:report]
'report' 'report'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment