diff --git a/evap/contributor/views.py b/evap/contributor/views.py index 842d1a28b6..3a0f463b46 100644 --- a/evap/contributor/views.py +++ b/evap/contributor/views.py @@ -288,6 +288,7 @@ def export_contributor_results(contributor): include_not_enough_voters=True, include_unpublished=False, contributor=contributor, + verbose_heading=False, ) return response diff --git a/evap/results/exporters.py b/evap/results/exporters.py index 2cce248693..7df05d4ec0 100644 --- a/evap/results/exporters.py +++ b/evap/results/exporters.py @@ -160,7 +160,7 @@ def filter_evaluations(semesters, evaluation_states, degrees, course_types, cont return evaluations_with_results, used_questionnaires, course_results_exist def write_headings_and_evaluation_info( - self, evaluations_with_results, semesters, contributor, degrees, course_types + self, evaluations_with_results, semesters, contributor, degrees, course_types, verbose_heading ): export_name = "Evaluation" if contributor: @@ -169,9 +169,13 @@ def write_headings_and_evaluation_info( export_name += f"\n{semesters[0].name}" degree_names = [degree.name for degree in Degree.objects.filter(pk__in=degrees)] course_type_names = [course_type.name for course_type in CourseType.objects.filter(pk__in=course_types)] - self.write_cell( - _("{}\n\n{}\n\n{}").format(export_name, ", ".join(degree_names), ", ".join(course_type_names)), "headline" - ) + if verbose_heading: + self.write_cell( + _("{}\n\n{}\n\n{}").format(export_name, ", ".join(degree_names), ", ".join(course_type_names)), + "headline", + ) + else: + self.write_cell(_("{}\n\n\n\n").format(export_name), "headline") for evaluation, __ in evaluations_with_results: title = evaluation.full_name @@ -285,7 +289,13 @@ def write_questionnaire(self, questionnaire, evaluations_with_results, contribut # pylint: disable=arguments-differ def export_impl( - self, semesters, selection_list, include_not_enough_voters=False, include_unpublished=False, contributor=None + self, + semesters, + selection_list, + include_not_enough_voters=False, + include_unpublished=False, + contributor=None, + verbose_heading=True, ): # We want to throw early here, since workbook.save() will throw an IndexError otherwise. assert len(selection_list) > 0 @@ -309,7 +319,7 @@ def export_impl( ) self.write_headings_and_evaluation_info( - evaluations_with_results, semesters, contributor, degrees, course_types + evaluations_with_results, semesters, contributor, degrees, course_types, verbose_heading ) for questionnaire in used_questionnaires: