mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 07:37:55 +08:00
FIX: Avoid validation error when deleting users with locked trust level
This commit is contained in:
@ -60,6 +60,7 @@ class GroupUser < ActiveRecord::Base
|
||||
|
||||
def recalculate_trust_level
|
||||
return if group.grant_trust_level.nil?
|
||||
return if self.destroyed_by_association&.active_record == User # User is being destroyed, so don't try to recalculate
|
||||
|
||||
Promotion.recalculate(user)
|
||||
end
|
||||
|
Reference in New Issue
Block a user