1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Merge branch 'develop' into develop-2.1

Conflicts:
	netbox/netbox/settings.py
This commit is contained in:
Jeremy Stretch
2017-06-15 14:26:02 -04:00
8 changed files with 141 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import MultipleObjectsReturned
from django.db.models import Count
from dcim.models import Site, Rack, Device, Interface
@@ -301,6 +302,10 @@ class PrefixCSVForm(forms.ModelForm):
))
else:
raise forms.ValidationError("Global VLAN {} not found in group {}".format(vlan_vid, vlan_group))
except MultipleObjectsReturned:
raise forms.ValidationError(
"Multiple VLANs with VID {} found in group {}".format(vlan_vid, vlan_group)
)
elif vlan_vid:
try:
self.instance.vlan = VLAN.objects.get(site=site, group__isnull=True, vid=vlan_vid)
@@ -309,6 +314,8 @@ class PrefixCSVForm(forms.ModelForm):
raise forms.ValidationError("VLAN {} not found in site {}".format(vlan_vid, site))
else:
raise forms.ValidationError("Global VLAN {} not found".format(vlan_vid))
except MultipleObjectsReturned:
raise forms.ValidationError("Multiple VLANs with VID {} found".format(vlan_vid))
class PrefixBulkEditForm(BootstrapMixin, CustomFieldBulkEditForm):
@@ -582,7 +589,7 @@ class IPAddressCSVForm(forms.ModelForm):
}
)
status = CSVChoiceField(
choices=PREFIX_STATUS_CHOICES,
choices=IPADDRESS_STATUS_CHOICES,
help_text='Operational status'
)
role = CSVChoiceField(