Browse Source

fix(resultats): gère convenablement l absence de résultat cassée par #54

pull/55/head
François Poulain 6 months ago
parent
commit
210b61b38f
  1. 3
      gvot/base/views.py
  2. 2
      gvot/templates/modeladmin/index_results.html

3
gvot/base/views.py

@ -654,6 +654,9 @@ class ScrutinResults(AdminMixin, CSVExportMixin, detail.DetailView): @@ -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):

2
gvot/templates/modeladmin/index_results.html

@ -33,7 +33,7 @@ @@ -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 %}

Loading…
Cancel
Save
Map all the world