diff --git a/lib/towerops_web/live/graph_live/show.ex b/lib/towerops_web/live/graph_live/show.ex index 45af36cf..4042890d 100644 --- a/lib/towerops_web/live/graph_live/show.ex +++ b/lib/towerops_web/live/graph_live/show.ex @@ -28,10 +28,8 @@ defmodule ToweropsWeb.GraphLive.Show do |> push_navigate(to: ~p"/devices")} device -> - # Preload site and organization to check access - device = Repo.preload(device, site: :organization) - - if device.site.organization_id == organization.id do + # Check if device belongs to current organization + if device.organization_id == organization.id do maybe_subscribe_to_device(socket, device_id) range = Map.get(params, "range", "24h")