Revision 7055982e

b/snf-cyclades-app/synnefo/ui/static/snf/js/models.js
1680 1680
                }
1681 1681
            };
1682 1682

  
1683
            if (type) {
1684
                params.network.type = type;
1683
            if (!type) {
1684
                throw "Network type cannot be empty";
1685 1685
            }
1686
            params.network.type = type;
1686 1687
            if (cidr) {
1687 1688
                params.network.cidr = cidr;
1688 1689
            }
b/snf-cyclades-app/synnefo/ui/static/snf/js/ui/web/ui_networks_view.js
219 219
                this.type_select.append($('<option value='+value+' class="subnet">'+name+'</option>'));
220 220
            }, this);
221 221
            
222
            this.disable_network_type = false;
223 222
            if (_.keys(synnefo.config.network_available_types).length <= 1) {
224
                this.disable_network_type = true;
225 223
                this.type_select.closest(".form-field").hide();
226 224
            }
227 225

  
......
339 337
            var subnet = null;
340 338
            var type = this.type_select.val();
341 339

  
342
            if (this.disable_network_type) { type = null };
343

  
344 340
            if (dhcp) {
345 341
                if (this.subnet_select.val() == "custom") {
346 342
                    subnet = this.subnet_custom.val();

Also available in: Unified diff