2
0
Fork 0
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:
Sam 2017-05-16 16:06:24 -04:00
parent 6ddd8d9166
commit 4b449914b8
2 changed files with 16 additions and 1 deletions

View file

@ -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