Skip to content

Commit

Permalink
fix merge problems and circular import problems
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoates committed Apr 10, 2024
1 parent e1538c0 commit 74d1942
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions api/routes/analysis_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from api.utils.db import (
Connection,
get_project_readonly_connection,
get_project_read_connection,
get_project_write_connection,
)
from db.python.layers.analysis_runner import AnalysisRunnerLayer
Expand Down Expand Up @@ -75,7 +75,7 @@ async def get_analysis_runner_logs(
repository: str | None = None,
access_level: str | None = None,
environment: str | None = None,
connection: Connection = get_project_readonly_connection,
connection: Connection = get_project_read_connection,
) -> list[AnalysisRunner]:
"""Get analysis runner logs"""

Expand Down
8 changes: 6 additions & 2 deletions db/python/tables/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ async def get_and_check_access_to_project_for_id(
if not has_access:
if raise_exception:
raise NoProjectAccess(
[project.name], allowed_roles=allowed_roles, author=user
[project.name],
allowed_roles=[r.name for r in allowed_roles],
author=user,
)
return None

Expand Down Expand Up @@ -289,7 +291,9 @@ async def get_and_check_access_to_projects_for_ids(

if missing_project_names:
raise NoProjectAccess(
missing_project_names, allowed_roles=allowed_roles, author=user
missing_project_names,
allowed_roles=[r.name for r in allowed_roles],
author=user,
)

return accessible_projects
Expand Down
5 changes: 1 addition & 4 deletions db/python/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
import logging
import os
import re
from enum import Enum
from typing import Any, Generic, TypeVar

from models.models.group import GroupProjectRole

T = TypeVar('T')

levels_map = {'DEBUG': logging.DEBUG, 'INFO': logging.INFO, 'WARNING': logging.WARNING}
Expand Down Expand Up @@ -66,7 +63,7 @@ def __init__(
self,
project_names: list[str],
author: str,
allowed_roles: set[GroupProjectRole],
allowed_roles: list[str],
*args: tuple[Any, ...],
):
project_names_str = ', '.join(project_names)
Expand Down

0 comments on commit 74d1942

Please sign in to comment.