mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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:
parent
e0bc6590fd
commit
6a54da0902
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user