From 38e43c981a86c9262e487360484bbec20b5b3341 Mon Sep 17 00:00:00 2001 From: Carmine Di Monaco Date: Mon, 13 May 2024 15:09:06 +0200 Subject: [PATCH] Rescue StaleError in user update function when abilities are present (#2622) --- lib/trento/users.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/trento/users.ex b/lib/trento/users.ex index 6099354903..d4fee5d285 100644 --- a/lib/trento/users.ex +++ b/lib/trento/users.ex @@ -154,6 +154,8 @@ defmodule Trento.Users do {:error, _, changeset_error, _} -> {:error, changeset_error} end + rescue + Ecto.StaleEntryError -> {:error, :stale_entry} end defp do_update(user, attrs) do