Commit b91c0ec618b64657d8b4ddc24153729098c92dbb

Thomas de Grivel 2021-12-11T17:52:26

fix repository changeset

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/lib/kmxgit/repository_manager/repository.ex b/lib/kmxgit/repository_manager/repository.ex
index 7dbf37b..a8b0dcb 100644
--- a/lib/kmxgit/repository_manager/repository.ex
+++ b/lib/kmxgit/repository_manager/repository.ex
@@ -29,6 +29,7 @@ defmodule Kmxgit.RepositoryManager.Repository do
   def owner_changeset(repository, attrs, owner, forked_from \\ nil)
   def owner_changeset(repository, attrs, owner = %Organisation{}, forked_from) do
     repository
+    |> cast(%{}, [])
     |> put_change(:organisation_id, owner.id)
     |> put_change(:user_id, nil)
     |> put_assoc(:organisation, owner)
@@ -38,6 +39,7 @@ defmodule Kmxgit.RepositoryManager.Repository do
   end
   def owner_changeset(repository, attrs, owner = %User{}, forked_from) do
     repository
+    |> cast(%{}, [])
     |> put_change(:organisation_id, nil)
     |> put_change(:user_id, owner.id)
     |> put_assoc(:organisation, nil)