Skip to content

Commit

Permalink
fix: Wrong impl of _in_project_scope
Browse files Browse the repository at this point in the history
  • Loading branch information
jopemachine committed Nov 11, 2024
1 parent a4d2eac commit 05c4f75
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ai/backend/manager/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,10 @@ async def _in_project_scope(
if group_row is None:
raise InvalidScope(f"Project not found (n:{scope.project_id})")

domain_row = sa.select(DomainRow).where(DomainRow.id == group_row.domain.name)
_domain_query_stmt = sa.select(DomainRow).where(DomainRow.name == group_row.domain.name)
domain_row = cast(Optional[DomainRow], await self.db_session.scalar(_domain_query_stmt))
if domain_row is None:
raise InvalidScope(f"Domain not found (n:{scope.domain_name})")

allowed_registries: set[str] = set(domain_row.allowed_docker_registries)
_img_query_stmt = sa.select(ImageRow).options(load_only(ImageRow.id, ImageRow.registry))
Expand Down

0 comments on commit 05c4f75

Please sign in to comment.