Skip to content

Commit dbebdf2

Browse files
author
clearml
committed
Fix project statistics calculation when both include and exclude child task filters present
1 parent e94d7fc commit dbebdf2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

apiserver/bll/project/project_bll.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def move_project(
170170

171171
now = datetime.utcnow()
172172
affected = set()
173+
p: Project
173174
for p in filter(None, (old_parent, new_parent)):
174175
p.update(last_update=now)
175176
affected.update({p.id, *(p.path or [])})
@@ -184,6 +185,7 @@ def update(cls, company: str, project_id: str, **fields):
184185

185186
new_name = fields.pop("name", None)
186187
if new_name:
188+
# noinspection PyTypeChecker
187189
new_name, new_location = _validate_project_name(new_name)
188190
old_name, old_location = _validate_project_name(project.name)
189191
if new_location != old_location:
@@ -823,7 +825,7 @@ def sum_status_count(
823825
}
824826

825827
def sum_runtime(
826-
a: Mapping[str, Mapping], b: Mapping[str, Mapping]
828+
a: Mapping[str, dict], b: Mapping[str, dict]
827829
) -> Dict[str, dict]:
828830
return {
829831
section: a.get(section, 0) + b.get(section, 0)
@@ -1059,7 +1061,7 @@ def get_task_parents(
10591061
if not parent_ids:
10601062
return []
10611063

1062-
parents = Task.get_many_with_join(
1064+
parents: Sequence[dict] = Task.get_many_with_join(
10631065
company_id,
10641066
query=Q(id__in=parent_ids),
10651067
query_dict={"name": name} if name else None,
@@ -1166,7 +1168,7 @@ def get_match_conditions(
11661168

11671169
if or_conditions:
11681170
if len(or_conditions) == 1:
1169-
conditions = next(iter(or_conditions))
1171+
conditions.update(next(iter(or_conditions)))
11701172
else:
11711173
conditions["$and"] = [c for c in or_conditions]
11721174

0 commit comments

Comments
 (0)