mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 02:48:38 -06:00
as_range: Catch TypeErrors
This commit is contained in:
parent
3e90dc9154
commit
e2a74c1478
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user