Skip to content

Commit

Permalink
Fix 6
Browse files Browse the repository at this point in the history
  • Loading branch information
nicl-nno committed Mar 15, 2024
1 parent 7abad85 commit 437c9d0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion app/api/composer/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

from .history_convert_utils import history_to_graph
from .schema import ComposingHistoryGraphSchema, ComposingStartSchema
from .service import composer_history_for_case, clean_case_id
from .service import composer_history_for_case
from utils import clean_case_id
from ..pipelines.service import pipeline_by_uid
from ..showcase.service import create_new_case_async
from ..showcase.showcase_utils import showcase_item_from_db
Expand Down
7 changes: 1 addition & 6 deletions app/api/composer/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
from app.api.pipelines.service import create_pipeline, is_pipeline_exists
from app.api.showcase.showcase_utils import showcase_item_from_db
from app.singletons.db_service import DBServiceSingleton
from utils import project_root


def clean_case_id(case_id: str):
case_id = case_id.replace('_full', '')
return case_id
from utils import project_root, clean_case_id


def composer_history_for_case(case_id: str, validate_history: bool = False) -> OptHistory:
Expand Down
2 changes: 1 addition & 1 deletion app/api/showcase/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from .models import ShowcaseItem, Metadata
from .showcase_utils import prepare_icon_path, showcase_item_from_db
from ..analytics.pipeline_analytics import get_metrics_for_pipeline, get_metrics_for_golem_individual
from ..composer.service import clean_case_id
from utils import clean_case_id


def showcase_full_item_by_uid(case_id: str) -> Optional[ShowcaseItem]:
Expand Down
2 changes: 1 addition & 1 deletion app/api/showcase/showcase_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from flask import url_for

from .models import ShowcaseItem
from ..composer.service import clean_case_id
from utils import clean_case_id


def showcase_item_from_db(case_id: str) -> Optional[ShowcaseItem]:
Expand Down
5 changes: 5 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ def wrapper(*args, **kwargs):
if callable(getattr(function, method)) and not method.startswith("__")]

return wrapper


def clean_case_id(case_id: str):
case_id = case_id.replace('_full', '')
return case_id

0 comments on commit 437c9d0

Please sign in to comment.