fix(resultats): gère convenablement l absence de résultat cassée par #54
Parent
995f067631
révision
210b61b38f
|
@ -654,6 +654,9 @@ class ScrutinResults(AdminMixin, CSVExportMixin, detail.DetailView):
|
|||
context['can_split_by'] = self.can_split_by
|
||||
context['split_by'] = self.verbose_split_by
|
||||
context['results'] = self.object.get_results(context['split_by'])
|
||||
context['has_results'] = any(
|
||||
[p['participation'] for _, _, p in context['results']]
|
||||
)
|
||||
return context
|
||||
|
||||
def dispatch(self, request, *args, **kwargs):
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</div>
|
||||
</header>
|
||||
<div class="nice-padding">
|
||||
{% if results %}
|
||||
{% if has_results %}
|
||||
<div class="overflow">
|
||||
{% for header, listing, participation in results %}
|
||||
{% if listing %}
|
||||
|
|
Chargement…
Référencer dans un nouveau ticket