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 @@ ...@@ -8,7 +8,7 @@
{% emission_nav %} {% emission_nav %}
{% endblock %} {% endblock %}
{% block main %} {% 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 id="Emission-container" class="emission padded">
<div data-tabbed="true" id="Emission-tabs-default"> <div data-tabbed="true" id="Emission-tabs-default">
<div id="Emission-tabs-detail" class="leftPart"> <div id="Emission-tabs-detail" class="leftPart">
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% if episodes %} {% if episodes.exists %}
<div class="sub"> <div class="sub">
<h5 class="sectionLabel">Dernier épisode</h5> <h5 class="sectionLabel">Dernier épisode</h5>
{% with episodes|slice:"0:1" as episodes %} {% with episodes|slice:"0:1" as episodes %}
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</header> </header>
</div> </div>
<div class="wrapper"> <div class="wrapper">
{% if episodes %} {% if episodes.exists %}
<div class="wrapper half"> <div class="wrapper half">
<nav> <nav>
<ul class="distributed by2"> <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