Commit 0cc5b7cc71e66f67162051ddddcb5e80fa520e5d

Thomas de Grivel 2022-02-19T19:48:28

fix organisation show

diff --git a/lib/kmxgit_web/controllers/slug_controller.ex b/lib/kmxgit_web/controllers/slug_controller.ex
index 3c87878..0ad9061 100644
--- a/lib/kmxgit_web/controllers/slug_controller.ex
+++ b/lib/kmxgit_web/controllers/slug_controller.ex
@@ -35,7 +35,7 @@ defmodule KmxgitWeb.SlugController do
       else
         org = slug.organisation
         if org do
-          repos = org.repositories
+          repos = org.owned_repositories
           |> Enum.filter(fn repo ->
             repo.public_access || Repository.member?(repo, current_user)
           end)
diff --git a/lib/kmxgit_web/templates/organisation/show.html.heex b/lib/kmxgit_web/templates/organisation/show.html.heex
index a6c0cd1..b5a3477 100644
--- a/lib/kmxgit_web/templates/organisation/show.html.heex
+++ b/lib/kmxgit_web/templates/organisation/show.html.heex
@@ -21,7 +21,7 @@
       <hr/>
       <h2><%= gettext "Repositories" %></h2>
       <ul>
-        <%= for repo <- Organisation.owned_repositories(@org) do %>
+        <%= for repo <- @repos do %>
           <li>
             <%= link Repository.full_slug(repo), to: Routes.repository_path(@conn, :show, @org.slug.slug, Repository.splat(repo)) %>
           </li>