mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 09:10:25 +08:00
FIX: admins could never remove self from messages
This commit is contained in:
parent
6ddd8d9166
commit
4b449914b8
2 changed files with 16 additions and 1 deletions
|
@ -698,6 +698,9 @@ SQL
|
|||
topic_user = topic_allowed_users.find_by(user_id: user.id)
|
||||
if topic_user
|
||||
topic_user.destroy
|
||||
# we can not remove ourselves cause then we will end up adding
|
||||
# ourselves in add_small_action
|
||||
removed_by = Discourse.system_user if user.id == removed_by.id
|
||||
add_small_action(removed_by, "removed_user", user.username)
|
||||
return true
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue