changeset 137:5a44d377aad5

Simplify code, don't use the map filter (Jinja>=2.7)
author Benoît Allard <benoit.allard@greenbone.net>
date Mon, 27 Oct 2014 11:20:06 +0100
parents 64a6e69d54fc
children 43cd11ba7928
files farol/templates/producttree/view_product.j2
diffstat 1 files changed, 14 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/farol/templates/producttree/view_product.j2	Mon Oct 27 10:54:52 2014 +0100
+++ b/farol/templates/producttree/view_product.j2	Mon Oct 27 11:20:06 2014 +0100
@@ -76,22 +76,20 @@
 {% call panel(heading="Vulnerabilities", title="3", collapsible=False) %}
   <p>The following Vulneralibities are mentionning this product:</p>
   <ul>
-    {% for vulnerability in cvrf._vulnerabilities if (
-               vulnerability.isMentioningProdId(product._productid) or
-               vulnerability.isMentioningGroupId(groups | map(attribute="_groupid") | list)) %}
-      <li>
-        <a href="{{ url_for('vulnerability.view', ordinal=vulnerability._ordinal) }}">{{ vulnerability.getTitle() }}</a>
-        {%- set elements = vulnerability.mentionsProdId(product._productid) | list %}
-        {%- for group in groups %}
-          {{- elements.extend(vulnerability.mentionsGroupId(group._groupid) | list) or '' }}
-        {%- endfor %}
-        {%- set comma = joiner(', ') %}
-        ({% for grouper, list in elements | groupby('NAME') %}{{ comma() -}}
-          {{ grouper }}{% if list | length > 1 %} (x{{ list | length }}){% endif %}
-        {%- endfor %})
-      </li>
-    {% else %}
-      <li><em>None</em></li>
+    {% for vulnerability in cvrf._vulnerabilities %}
+      {%- set elements = vulnerability.mentionsProdId(product._productid) | list %}
+      {%- for group in groups %}
+        {{- elements.extend(vulnerability.mentionsGroupId(group._groupid) | list) or '' }}
+      {%- endfor %}
+      {% if elements %}
+        <li>
+          <a href="{{ url_for('vulnerability.view', ordinal=vulnerability._ordinal) }}">{{ vulnerability.getTitle() }}</a>
+          {%- set comma = joiner(', ') %}
+          ({% for grouper, list in elements | groupby('NAME') %}{{ comma() -}}
+            {{ grouper }}{% if list | length > 1 %} (x{{ list | length }}){% endif %}
+          {%- endfor %})
+        </li>
+      {% endif %}
     {% endfor %}
   </ul>
 {% endcall %}

http://farol.wald.intevation.org