feat(user_live): handle system user in form and show

Early return / load_user_or_redirect, use system_user? to avoid editing system actor.
This commit is contained in:
Moritz 2026-01-27 17:37:40 +01:00 committed by moritz
parent a10c770ca7
commit cbcb93418e
2 changed files with 15 additions and 17 deletions

View file

@ -75,7 +75,7 @@ defmodule MvWeb.UserLive.Show do
actor = current_actor(socket)
user = Ash.get!(Mv.Accounts.User, id, domain: Mv.Accounts, load: [:member], actor: actor)
if to_string(user.email) == Mv.Helpers.SystemActor.system_user_email() do
if Mv.Helpers.SystemActor.system_user?(user) do
{:ok,
socket
|> put_flash(:error, gettext("This user cannot be viewed."))