mirror of
https://github.com/clearml/clearml-server
synced 2025-01-31 02:46:53 +00:00
Return only reports from the .reports projects in reports.get_all_ex
This commit is contained in:
parent
900414d0de
commit
d9579891c8
@ -3,6 +3,8 @@ from datetime import datetime
|
|||||||
from itertools import chain
|
from itertools import chain
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
|
|
||||||
|
from mongoengine import Q
|
||||||
|
|
||||||
from apiserver.apimodels.reports import (
|
from apiserver.apimodels.reports import (
|
||||||
CreateReportRequest,
|
CreateReportRequest,
|
||||||
UpdateReportRequest,
|
UpdateReportRequest,
|
||||||
@ -177,12 +179,14 @@ def get_all_ex(call: APICall, company_id, request: GetAllRequest):
|
|||||||
project_ids = call_data["project"]
|
project_ids = call_data["project"]
|
||||||
if not isinstance(project_ids, list):
|
if not isinstance(project_ids, list):
|
||||||
project_ids = [project_ids]
|
project_ids = [project_ids]
|
||||||
call_data["project"] = [
|
|
||||||
*project_ids,
|
query = Q(parent__in=project_ids) | Q(id__in=project_ids)
|
||||||
*Project.objects(
|
project_ids = Project.objects(
|
||||||
parent__in=project_ids, basename=reports_project_name
|
query & Q(basename=reports_project_name)
|
||||||
).scalar("id"),
|
).scalar("id")
|
||||||
]
|
if not project_ids:
|
||||||
|
return {"tasks": []}
|
||||||
|
call_data["project"] = list(project_ids)
|
||||||
|
|
||||||
ret_params = {}
|
ret_params = {}
|
||||||
tasks = Task.get_many_with_join(
|
tasks = Task.get_many_with_join(
|
||||||
|
Loading…
Reference in New Issue
Block a user