Commit 03b73ce9fe5770fad70f966d8ee756644d3a7b35

Thomas de Grivel 2024-05-14T19:08:49

repository_controller: use Ecto.Changeset to get the updated public_access value in error page.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/lib/kmxgit_web/controllers/repository_controller.ex b/lib/kmxgit_web/controllers/repository_controller.ex
index 17030c0..a6d5526 100644
--- a/lib/kmxgit_web/controllers/repository_controller.ex
+++ b/lib/kmxgit_web/controllers/repository_controller.ex
@@ -15,6 +15,7 @@ defmodule KmxgitWeb.RepositoryController do
   use KmxgitWeb, :controller
   require Logger
 
+  alias Ecto.Changeset
   alias Kmxgit.Git
   alias Kmxgit.GitAuth
   alias Kmxgit.GitManager
@@ -462,7 +463,7 @@ defmodule KmxgitWeb.RepositoryController do
         |> assign(:changeset, changeset)
         |> assign_current_organisation(owner)
         |> assign(:owner, owner)
-        |> assign(:public_access, changeset.public_access)
+        |> assign(:public_access, Changeset.get_field(changeset, :public_access, false))
         |> render("new.html")
     end
   end