mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:31:10 +08:00
FIX: raise invalid params for bad callback
Corrects it so we raise a 400 instead of logged 500 error
This commit is contained in:
@ -69,7 +69,11 @@ class GroupsController < ApplicationController
|
||||
end
|
||||
|
||||
if type = params[:type]&.to_sym
|
||||
groups = TYPE_FILTERS[type].call(groups, current_user)
|
||||
callback = TYPE_FILTERS[type]
|
||||
if !callback
|
||||
raise Discourse::InvalidParameters.new(:type)
|
||||
end
|
||||
groups = callback.call(groups, current_user)
|
||||
end
|
||||
|
||||
if current_user
|
||||
|
Reference in New Issue
Block a user