1. indifex
  2. transifex


Apostolis Bessas  committed 4a04356

use 0 as default priority level, in case one does not exist.

  • Participants
  • Parent commits 8c639c6
  • Branches default

Comments (0)

Files changed (1)

File transifex/addons/priorities/templatetags/priority_images.py

View file
 from django import template
 from django.utils.safestring import mark_safe
+from priorities.models import PRIORITY_LEVELS
 register = template.Library()
 def priority_image_path(level):
     """Return the path to the appropriate image for the specified level."""
+    if level not in map(lambda e: e[0], PRIORITY_LEVELS):
+        level = 0
     return mark_safe("priorities/images/%s.png" % level)