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 Jan 30, 2025
1 parent deb87e9 commit 595edd3
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 @@ -42,9 +42,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 @@ -925,12 +922,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 595edd3

Please sign in to comment.