FIX: Avoid validation error when deleting users with locked trust level

This commit is contained in:
David Taylor
2020-07-27 17:40:10 +01:00
parent f32cc04ddc
commit 407bb96a22
2 changed files with 12 additions and 1 deletions

View File

@ -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