Explorar el Código

as_range: Catch TypeErrors

Jeremy Stretch hace 5 años
padre
commit
278c881059
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      netbox/utilities/templatetags/helpers.py

+ 4 - 0
netbox/utilities/templatetags/helpers.py

@@ -213,6 +213,10 @@ def as_range(n):
     """
     """
     Return a range of n items.
     Return a range of n items.
     """
     """
+    try:
+        int(n)
+    except TypeError:
+        return list()
     return range(n)
     return range(n)