Commit 71176d7a910cf19249cea3820aaff6a7d5a5b15e

Thomas de Grivel 2021-12-07T14:26:55

cannot change owner for new repository

diff --git a/lib/kmxgit_web/templates/repository/form.html.heex b/lib/kmxgit_web/templates/repository/form.html.heex
index 1b84fbe..814dead 100644
--- a/lib/kmxgit_web/templates/repository/form.html.heex
+++ b/lib/kmxgit_web/templates/repository/form.html.heex
@@ -23,11 +23,13 @@
     <%= error_tag f, :deploy_keys %>
   </div>
 
-  <div class="mb-3">
-    <%= label f, :owner_slug, gettext("Change owner ⚠"), class: "form-label" %>
-    <%= text_input f, :owner_slug, class: "form-control" %>
-    <%= error_tag f, :owner_slug %>
-  </div>
+  <%= if @conn.assigns[:current_repository] do %>
+    <div class="mb-3">
+      <%= label f, :owner_slug, gettext("Change owner ⚠"), class: "form-label" %>
+      <%= text_input f, :owner_slug, class: "form-control" %>
+      <%= error_tag f, :owner_slug %>
+    </div>
+  <% end %>
 
   <div class="mb-3">
     <%= if @conn.assigns[:current_repository] do %>