FIX: Don't raise an exception if we can't update the user on demotion

This is causing issues when purging old users, if they are set up in the
exact condition where they will be demoted into another group, but also
do not have a primary email.
This commit is contained in:
Robin Ward
2020-06-22 15:43:59 -04:00
parent d473ddd02c
commit ac9577bcc7
2 changed files with 13 additions and 2 deletions

View File

@ -126,8 +126,8 @@ class Promotion
# Then consider the group locked level
user_group_granted_trust_level = user.group_granted_trust_level
unless user_group_granted_trust_level.blank?
return user.update!(
if user_group_granted_trust_level.present?
return user.update(
trust_level: user_group_granted_trust_level
)
end