FIX: Don't trigger user_updated event for bot users.

This commit is contained in:
Guo Xiang Tan 2020-05-08 09:27:26 +08:00
parent a3e1e9ef16
commit efd0e4d02b
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20
1 changed files with 4 additions and 1 deletions

View File

@ -127,7 +127,10 @@ class User < ActiveRecord::Base
after_create :set_default_categories_preferences
after_create :set_default_tags_preferences
after_update :trigger_user_updated_event, if: :saved_change_to_uploaded_avatar_id?
after_update :trigger_user_updated_event, if: Proc.new {
self.human? && self.saved_change_to_uploaded_avatar_id?
}
after_update :trigger_user_automatic_group_refresh, if: :saved_change_to_staged?
before_save :update_usernames