Commit 1346517cbfdafa767aefe0130203b4ebcbe869a3

Thomas de Grivel 2024-10-21T14:43:04

fix admin user create

diff --git a/lib/kmxgit/user_manager.ex b/lib/kmxgit/user_manager.ex
index 29cc3cb..b75c4c3 100644
--- a/lib/kmxgit/user_manager.ex
+++ b/lib/kmxgit/user_manager.ex
@@ -306,7 +306,7 @@ defmodule Kmxgit.UserManager do
     end
   end
 
-  def admin_create_user(attrs \\ %{}) do
+  def admin_create_user(attrs) do
     changeset = User.admin_create_user_changeset(%User{}, attrs)
     with {:ok, user} <- Repo.insert(changeset) do
       {:ok, user, changeset}
diff --git a/lib/kmxgit_web/templates/admin/user/form.html.heex b/lib/kmxgit_web/templates/admin/user/form.html.heex
index cbff28a..52b059c 100644
--- a/lib/kmxgit_web/templates/admin/user/form.html.heex
+++ b/lib/kmxgit_web/templates/admin/user/form.html.heex
@@ -15,6 +15,7 @@
   <div class="mb-3">
     <%= label f, :slug_, gettext("Login"), class: "form-label" %>
     <%= text_input f, :slug_, class: "form-control" %>
+    <%= error_tag f, :slug %>
     <%= error_tag f, :slug_ %>
   </div>