Skip to content

A platform for community discussion. Free, open, simple.

FIX: only unstage staged users

Régis Hanol3e06598e96e0
diff --git a/app/models/user.rb b/app/models/user.rb
index d46bd6a8439..2913c8acaed 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -270,10 +270,12 @@ class User < ActiveRecord::Base
end
def unstage
- self.staged = false
- self.custom_fields[FROM_STAGED] = true
- self.notifications.destroy_all
- DiscourseEvent.trigger(:user_unstaged, self)
+ if self.staged
+ self.staged = false
+ self.custom_fields[FROM_STAGED] = true
+ self.notifications.destroy_all
+ DiscourseEvent.trigger(:user_unstaged, self)
+ end
end
def self.unstage(params)