mirror of
https://github.com/discourse/discourse.git
synced 2025-04-29 18:14:35 +08:00
FIX: only unstage staged users
This commit is contained in:
parent
52f9112d63
commit
3e06598e96
@ -270,11 +270,13 @@ class User < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def unstage
|
def unstage
|
||||||
|
if self.staged
|
||||||
self.staged = false
|
self.staged = false
|
||||||
self.custom_fields[FROM_STAGED] = true
|
self.custom_fields[FROM_STAGED] = true
|
||||||
self.notifications.destroy_all
|
self.notifications.destroy_all
|
||||||
DiscourseEvent.trigger(:user_unstaged, self)
|
DiscourseEvent.trigger(:user_unstaged, self)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def self.unstage(params)
|
def self.unstage(params)
|
||||||
if user = User.where(staged: true).with_email(params[:email].strip.downcase).first
|
if user = User.where(staged: true).with_email(params[:email].strip.downcase).first
|
||||||
|
Loading…
x
Reference in New Issue
Block a user