Explorar o código

Cast all query param values to string

Jeremy Stretch %!s(int64=5) %!d(string=hai) anos
pai
achega
b4299241fe
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      netbox/utilities/forms/widgets.py

+ 2 - 2
netbox/utilities/forms/widgets.py

@@ -142,9 +142,9 @@ class APISelect(SelectWithDisabled):
 
 
         values = json.loads(self.attrs.get(key, '[]'))
         values = json.loads(self.attrs.get(key, '[]'))
         if type(value) is list:
         if type(value) is list:
-            values.extend(value)
+            values.extend([str(v) for v in value])
         else:
         else:
-            values.append(value)
+            values.append(str(value))
 
 
         self.attrs[key] = json.dumps(values)
         self.attrs[key] = json.dumps(values)