Fix grouping by version
This commit is contained in:
@@ -2,6 +2,7 @@ from typing import List, Optional, Dict, Tuple
|
||||
from redminelib import Redmine
|
||||
from redminelib.resources import Issue
|
||||
from .config import Config
|
||||
from .utils import get_version
|
||||
|
||||
|
||||
def fetch_issues_with_spent_time(from_date: str, to_date: str) -> Optional[List[Tuple[Issue, float]]]:
|
||||
@@ -51,6 +52,7 @@ def fetch_issues_with_spent_time(from_date: str, to_date: str) -> Optional[List[
|
||||
total_hours = spent_time.get(issue.id, 0.0)
|
||||
result.append((issue, total_hours))
|
||||
|
||||
# Сортируем по проекту (Redmine API уже сортирует, но для надёжности)
|
||||
result.sort(key=lambda x: str(x[0].project))
|
||||
# Сортируем по (проект, версия)
|
||||
result.sort(key=lambda x: (str(x[0].project), get_version(x[0])))
|
||||
|
||||
return result
|
||||
|
||||
Reference in New Issue
Block a user