mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
DEV: Show message when cannot invite user to PM (#10336)
* DEV: Show message when cannot invite user to PM When inviting a user to a PM return a message that says, "Sorry, this user can't be invited." if they have been muted or are not in a users allowed pm users list. * Minor refactor & improved some text
This commit is contained in:
@ -689,7 +689,7 @@ class TopicsController < ApplicationController
|
||||
|
||||
render json: json, status: 422
|
||||
end
|
||||
rescue Topic::UserExists => e
|
||||
rescue Topic::UserExists, Topic::NotAllowed => e
|
||||
render json: { errors: [e.message] }, status: 422
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user