Просмотр исходного кода

Fixes #2998: Limit device query to non-racked devices if no rack selected when creating a cable

Jeremy Stretch 7 лет назад
Родитель
Сommit
f6345b9a5d
2 измененных файлов с 4 добавлено и 0 удалено
  1. 1 0
      CHANGELOG.md
  2. 3 0
      netbox/project-static/js/forms.js

+ 1 - 0
CHANGELOG.md

@@ -6,6 +6,7 @@ v2.5.9 (FUTURE)
 * [#2577](https://github.com/digitalocean/netbox/issues/2577) - Clarification of wording in API regarding filtering
 * [#2924](https://github.com/digitalocean/netbox/issues/2924) - Add interface type for QSFP28 50GE
 * [#2936](https://github.com/digitalocean/netbox/issues/2936) - Fix device role selection showing duplicate first entry
+* [#2998](https://github.com/digitalocean/netbox/issues/2998) - Limit device query to non-racked devices if no rack selected when creating a cable
 
 v2.5.8 (2019-03-11)
 

+ 3 - 0
netbox/project-static/js/forms.js

@@ -155,10 +155,13 @@ $(document).ready(function() {
 
                 filter_for_elements.each(function(index, filter_for_element) {
                     var param_name = $(filter_for_element).attr(attr_name);
+                    var is_nullable = $(filter_for_element).attr("nullable");
                     var value = $(filter_for_element).val();
 
                     if (param_name && value) {
                         parameters[param_name] = value;
+                    } else if (param_name && is_nullable) {
+                        parameters[param_name] = "null";
                     }
                 });