Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix error with multiple invitations

Uku Taht388fc39d5e85
diff --git a/lib/plausible_web/controllers/auth_controller.ex b/lib/plausible_web/controllers/auth_controller.ex
index dfb8787096..8849792a26 100644
--- a/lib/plausible_web/controllers/auth_controller.ex
+++ b/lib/plausible_web/controllers/auth_controller.ex
@@ -134,7 +134,11 @@ defmodule PlausibleWeb.AuthController do
def activate_form(conn, _params) do
user = conn.assigns[:current_user]
- invitation = Repo.get_by(Plausible.Auth.Invitation, email: user.email)
+
+ has_invitation = Repo.exists?(
+ from i in Plausible.Auth.Invitation,
+ where: i.email == ^user.email
+ )
has_code =
Repo.exists?(
@@ -144,7 +148,7 @@ defmodule PlausibleWeb.AuthController do
render(conn, "activate.html",
has_pin: has_code,
- invitation: invitation,
+ has_invitation: has_invitation,
layout: {PlausibleWeb.LayoutView, "focus.html"}
)
end
diff --git a/lib/plausible_web/templates/auth/activate.html.eex b/lib/plausible_web/templates/auth/activate.html.eex
index d009f67f59..723b77ea85 100644
--- a/lib/plausible_web/templates/auth/activate.html.eex
+++ b/lib/plausible_web/templates/auth/activate.html.eex
@@ -47,7 +47,7 @@
</div>
<% end %>
- <%= if !@invitation do %>
+ <%= if !@has_invitation do %>
<div class="pt-12 pl-8 hidden md:block">
<%= render(PlausibleWeb.AuthView, "_onboarding_steps.html", current_step: 1) %>
</div>
diff --git a/lib/plausible_web/templates/site/settings_people.html.eex b/lib/plausible_web/templates/site/settings_people.html.eex
index 5918bd4288..a67cfd9e42 100644
--- a/lib/plausible_web/templates/site/settings_people.html.eex
+++ b/lib/plausible_web/templates/site/settings_people.html.eex
@@ -7,7 +7,7 @@
<% end %>
</header>
<div class="flow-root mt-6">
- <ul class="-my-5 divide-y divide-gray-200">
+ <ul class="-my-5 divide-y divide-gray-200 dark:divide-gray-50">
<%= for membership <- @site.memberships do %>
<li class="py-4">
<div class="flex items-center space-x-4">
@@ -15,7 +15,7 @@
<%= gravatar(membership.user.email, class: "h-8 w-8 rounded-full") %>
</div>
<div class="flex-1 min-w-0">
- <p class="text-sm font-medium text-gray-900 truncate">
+ <p class="text-sm font-medium text-gray-900 dark:text-gray-50 truncate">
<%= membership.user.name %>
</p>
<p class="text-sm text-gray-500 truncate">