Commit c61a52a0 authored by fred's avatar fred
Browse files

performance: use .exists to check for non empty queryset

parent a7438adc
......@@ -8,7 +8,7 @@
{% emission_nav %}
{% endblock %}
{% block main %}
<div class="wrapper {% if episodes %}sided{% endif %} cf">
<div class="wrapper {% if episodes.exists %}sided{% endif %} cf">
<div id="Emission-container" class="emission padded">
<div data-tabbed="true" id="Emission-tabs-default">
<div id="Emission-tabs-detail" class="leftPart">
......@@ -46,7 +46,7 @@
{% endfor %}
</div>
{% endif %}
{% if episodes %}
{% if episodes.exists %}
<div class="sub">
<h5 class="sectionLabel">Dernier épisode</h5>
{% with episodes|slice:"0:1" as episodes %}
......
......@@ -55,7 +55,7 @@
</header>
</div>
<div class="wrapper">
{% if episodes %}
{% if episodes.exists %}
<div class="wrapper half">
<nav>
<ul class="distributed by2">
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment