Skip to content

Commit 5e4b295

Browse files
committed
Теперь возвращается структура таблицы вместо пустой страницы, даже если ни одной оценки нет
1 parent 4c43b92 commit 5e4b295

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

partner_programs/admin.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,17 @@ def _get_prepared_rates_data_for_export(self, program_id: int) -> list[dict]:
285285
scores_dict.setdefault(score.project_id, []).append(score)
286286

287287
if not scores_dict:
288-
return []
288+
empty_row: dict[str, str] = {
289+
"Название проекта": "",
290+
"Фамилия эксперта": "",
291+
}
292+
for field in program_fields:
293+
empty_row[field.label] = ""
294+
for criteria in criterias_without_comment:
295+
empty_row[criteria.name] = ""
296+
if comment_criteria:
297+
empty_row["Комментарий"] = ""
298+
return [empty_row]
289299

290300
project_ids = list(scores_dict.keys())
291301

0 commit comments

Comments
 (0)