fix device page

This commit is contained in:
Graham McIntire 2026-02-04 16:17:07 -06:00
parent fc66109f19
commit 031880c954
No known key found for this signature in database

View file

@ -55,10 +55,9 @@ defmodule ToweropsWeb.DeviceLive.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 organization access using denormalized organization_id field
# Works for both devices with sites and devices without sites
if device.organization_id == organization.id do
maybe_subscribe_and_schedule_refresh(socket, id)
tab = Map.get(params, "tab", "overview")