FIX: only unstage staged users

This commit is contained in:
Régis Hanol 2018-05-14 12:03:15 +02:00
parent 52f9112d63
commit 3e06598e96

View File

@ -270,10 +270,12 @@ class User < ActiveRecord::Base
end end
def unstage def unstage
self.staged = false if self.staged
self.custom_fields[FROM_STAGED] = true self.staged = false
self.notifications.destroy_all self.custom_fields[FROM_STAGED] = true
DiscourseEvent.trigger(:user_unstaged, self) self.notifications.destroy_all
DiscourseEvent.trigger(:user_unstaged, self)
end
end end
def self.unstage(params) def self.unstage(params)