FIX: catch the PG::UniqueViolation exception too
This commit is contained in:
parent
1aa7cf842a
commit
56b9528de8
|
@ -14,7 +14,7 @@ module Jobs
|
||||||
domains = group.automatic_membership_email_domains.gsub('.', '\.')
|
domains = group.automatic_membership_email_domains.gsub('.', '\.')
|
||||||
|
|
||||||
User.where("email ~* '@(#{domains})$'").find_each do |user|
|
User.where("email ~* '@(#{domains})$'").find_each do |user|
|
||||||
group.add(user) rescue ActiveRecord::RecordNotUnique
|
group.add(user) rescue ActiveRecord::RecordNotUnique, PG::UniqueViolation
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue