mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 13:24:58 +08:00
FIX: raise Discourse::NotFound
unless the user is present
This commit is contained in:
parent
10cc698df3
commit
61eff22b29
|
@ -500,9 +500,10 @@ class TopicsController < ApplicationController
|
|||
def remove_allowed_user
|
||||
params.require(:username)
|
||||
topic = Topic.find_by(id: params[:topic_id])
|
||||
user = User.find_by(username: params[:username])
|
||||
|
||||
raise Discourse::NotFound unless topic
|
||||
user = User.find_by(username: params[:username])
|
||||
raise Discourse::NotFound unless user
|
||||
|
||||
guardian.ensure_can_remove_allowed_users!(topic, user)
|
||||
|
||||
if topic.remove_allowed_user(current_user, user)
|
||||
|
|
Loading…
Reference in New Issue
Block a user