Commit 6d52e0cb9019b12f3c11e3376673264df146dbfe

Authored by Antonio Terceiro
1 parent 806a1665

ActionItem1165: fixing e-mail view

Showing 1 changed file with 2 additions and 3 deletions   Show diff stats
util/mail/postgresql/mail_users.sql
@@ -27,15 +27,14 @@ JOIN domains on @@ -27,15 +27,14 @@ JOIN domains on
27 ( 27 (
28 ( 28 (
29 profiles.preferred_domain_id is null and 29 profiles.preferred_domain_id is null and
30 - domain.is_default and 30 + domains.is_default and
31 domains.owner_id = environments.id and 31 domains.owner_id = environments.id and
32 domains.owner_type = 'Environment' 32 domains.owner_type = 'Environment'
33 ) 33 )
34 OR 34 OR
35 ( 35 (
36 profiles.preferred_domain_id is not null and 36 profiles.preferred_domain_id is not null and
37 - domains.owner_id = profiles.id and  
38 - domains.owner_type = 'Profile' 37 + domains.id = profiles.preferred_domain_id
39 ) 38 )
40 ) 39 )
41 WHERE 40 WHERE