Skip to content

Commit

Permalink
fix: Improve _in_project_scope using relationship
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Nov 20, 2024
1 parent 7117c6b commit 28107a1
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/ai/backend/manager/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@

from ..api.exceptions import ImageNotFound
from ..container_registry import get_container_registry_cls
from ..models.association_container_registries_groups import (
AssociationContainerRegistriesGroupsRow,
)
from ..models.container_registry import ContainerRegistryRow
from .base import (
GUID,
Expand Down Expand Up @@ -796,12 +793,8 @@ async def _in_project_scope(
ContainerRegistryRow.is_global == true(),
sa.and_(
ContainerRegistryRow.is_global == false(),
sa.exists().where(
(AssociationContainerRegistriesGroupsRow.group_id == scope.project_id)
& (
AssociationContainerRegistriesGroupsRow.registry_id
== ImageRow.registry_id
)
ContainerRegistryRow.association_container_registries_groups_rows.any(
group_id=scope.project_id
),
),
)
Expand Down

0 comments on commit 28107a1

Please sign in to comment.