diff --git a/lib/plausible/sites.ex b/lib/plausible/sites.ex index 6a2b783d7..6b34c721d 100644 --- a/lib/plausible/sites.ex +++ b/lib/plausible/sites.ex @@ -20,9 +20,7 @@ defmodule Plausible.Sites do from(s in Plausible.Site, left_join: sm in assoc(s, :memberships), left_join: i in assoc(s, :invitations), - where: - (is_nil(i.id) and sm.user_id == ^user.id) or - (not is_nil(i.id) and i.email == ^user.email), + where: sm.user_id == ^user.id or i.email == ^user.email, select: %{ s | list_type: