FIX: do not add user to group based on email domain unless email is confirmed

This commit is contained in:
Arpit Jalan
2017-03-28 14:50:36 +05:30
parent bace6af404
commit 4812417192
2 changed files with 12 additions and 2 deletions

View File

@@ -939,8 +939,7 @@ class User < ActiveRecord::Base
def automatic_group_membership
user = User.find(self.id)
return unless user && user.active && !user.staged
return unless user && user.active && user.email_confirmed? && !user.staged
Group.where(automatic: false)
.where("LENGTH(COALESCE(automatic_membership_email_domains, '')) > 0")