mirror of
https://github.com/plausible/analytics.git
synced 2024-12-23 17:44:43 +03:00
Fix sites query invitation left join lookup (#3480)
This commit is contained in:
parent
30b4dc2872
commit
6e6508a359
@ -20,7 +20,9 @@ defmodule Plausible.Sites do
|
||||
from(s in Plausible.Site,
|
||||
left_join: sm in assoc(s, :memberships),
|
||||
left_join: i in assoc(s, :invitations),
|
||||
where: sm.user_id == ^user.id or i.email == ^user.email,
|
||||
where:
|
||||
(is_nil(i.id) and sm.user_id == ^user.id) or
|
||||
(not is_nil(i.id) and i.email == ^user.email),
|
||||
select: %{
|
||||
s
|
||||
| list_type:
|
||||
|
Loading…
Reference in New Issue
Block a user