diff --git a/app/jobs/regular/automatic_group_membership.rb b/app/jobs/regular/automatic_group_membership.rb index ae524685cfb..b849b018b29 100644 --- a/app/jobs/regular/automatic_group_membership.rb +++ b/app/jobs/regular/automatic_group_membership.rb @@ -14,7 +14,11 @@ module Jobs domains = group.automatic_membership_email_domains.gsub('.', '\.') User.where("email ~* '@(#{domains})$'").find_each do |user| - group.add(user) rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation + begin + group.add(user) + rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation + # we don't care about this + end end end