   end
 
   def get_public_contest(id) do
-    public_contests_query() |> Repo.get(id)
+    public_contests_query() |> preload(:host) |> Repo.get(id)
   end
 
   def get_public_contest!(id) do
-    public_contests_query() |> Repo.get!(id)
+    public_contests_query() |> preload(:host) |> Repo.get!(id)
   end
 
   @doc """

  """
  def list_public_contests(opts \\ []) do
    query =
      from c in Contest,
        where: c.timetables_public,
        join: h in assoc(c, :host),
        join: cc in assoc(c, :contest_categories),
        join: p in assoc(cc, :performances),
        order_by: [
          {:desc, c.start_date},
          {:desc, c.end_date},
          {:desc, c.round},
          h.name,
          cc.inserted_at
        ],
        preload: [host: {h, [stages: ^stages_query()]}, contest_categories: {cc, :category}]

    query =
      if opts[:current_only] do

      left_join: u in assoc(h, :users),
      as: :users
  end

  defp preloaded_with_stages(contest_query) do
    from [contests: c] in contest_query,
      join: h in assoc(c, :host),
      as: :hosts,
      join: cc in assoc(c, :contest_categories),
      as: :contest_categories,
      join: p in assoc(cc, :performances),
      preload: [host: {h, [stages: ^stages_query()]}, contest_categories: {cc, :category}]
  end
end
