Ryan Breaker 8 лет назад
Родитель
Сommit
3d023126ba
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      netbox/utilities/forms.py

+ 3 - 2
netbox/utilities/forms.py

@@ -89,9 +89,10 @@ def parse_alphanumeric_range(string):
         try:
         try:
             begin, end = dash_range.split('-')
             begin, end = dash_range.split('-')
             # Skip if incompatible types or mixed case, just like any other bad pattern
             # Skip if incompatible types or mixed case, just like any other bad pattern
-            if (str.isalpha(begin) and str.isdigit(end)) or (str.isdigit(begin) and str.isalpha(end)):
+            vals = begin + end
+            if not (vals.isdigit() or vals.isalpha()):
                 continue
                 continue
-            if not (str.isupper(begin + end) or str.islower(begin + end)):
+            if vals.isalpha() and not (vals.isupper() or vals.islower()):
                 continue
                 continue
         except ValueError:
         except ValueError:
             begin, end = dash_range, dash_range
             begin, end = dash_range, dash_range