mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-20 02:06:42 -06:00
Merge branch 'develop' into 568-csv-import-cf
This commit is contained in:
commit
b11224a8b4
@ -1,4 +1,4 @@
|
||||
# v2.7.1 (FUTURE)
|
||||
# v2.7.2 (FUTURE)
|
||||
|
||||
## Enhancements
|
||||
|
||||
@ -6,6 +6,16 @@
|
||||
|
||||
---
|
||||
|
||||
# v2.7.1 (2020-01-16)
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
* [#3941](https://github.com/netbox-community/netbox/issues/3941) - Fixed exception when attempting to assign IP to interface
|
||||
* [#3943](https://github.com/netbox-community/netbox/issues/3943) - Prevent rack elevation links from opening new tabs/windows
|
||||
* [#3944](https://github.com/netbox-community/netbox/issues/3944) - Fix AttributeError exception when viewing prefixes list
|
||||
|
||||
---
|
||||
|
||||
# v2.7.0 (2020-01-16)
|
||||
|
||||
**Note:** This release completely removes the topology map feature ([#2745](https://github.com/netbox-community/netbox/issues/2745)).
|
||||
|
@ -390,7 +390,9 @@ class RackElevationHelperMixin:
|
||||
color = device.device_role.color
|
||||
link = drawing.add(
|
||||
drawing.a(
|
||||
reverse('dcim:device', kwargs={'pk': device.pk}), fill='black'
|
||||
href=reverse('dcim:device', kwargs={'pk': device.pk}),
|
||||
target='_top',
|
||||
fill='black'
|
||||
)
|
||||
)
|
||||
link.add(drawing.rect(start, end, fill='#{}'.format(color)))
|
||||
@ -405,10 +407,13 @@ class RackElevationHelperMixin:
|
||||
@staticmethod
|
||||
def _draw_empty(drawing, rack, start, end, text, id_, face_id, class_):
|
||||
link = drawing.add(
|
||||
drawing.a('{}?{}'.format(
|
||||
reverse('dcim:device_add'),
|
||||
urlencode({'rack': rack.pk, 'site': rack.site.pk, 'face': face_id, 'position': id_})
|
||||
))
|
||||
drawing.a(
|
||||
href='{}?{}'.format(
|
||||
reverse('dcim:device_add'),
|
||||
urlencode({'rack': rack.pk, 'site': rack.site.pk, 'face': face_id, 'position': id_})
|
||||
),
|
||||
target='_top'
|
||||
)
|
||||
)
|
||||
link.add(drawing.rect(start, end, class_=class_))
|
||||
link.add(drawing.text("add device", insert=text, class_='add-device'))
|
||||
|
@ -1,6 +1,6 @@
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from netaddr import AddrFormatError, IPNetwork, IPAddress
|
||||
from netaddr import AddrFormatError, IPNetwork
|
||||
|
||||
from . import lookups
|
||||
from .formfields import IPFormField
|
||||
@ -23,11 +23,9 @@ class BaseIPField(models.Field):
|
||||
if not value:
|
||||
return value
|
||||
try:
|
||||
if '/' in str(value):
|
||||
return IPNetwork(value)
|
||||
else:
|
||||
return IPAddress(value)
|
||||
except AddrFormatError as e:
|
||||
# Always return a netaddr.IPNetwork object. (netaddr.IPAddress does not provide a mask.)
|
||||
return IPNetwork(value)
|
||||
except AddrFormatError:
|
||||
raise ValidationError("Invalid IP address format: {}".format(value))
|
||||
except (TypeError, ValueError) as e:
|
||||
raise ValidationError(e)
|
||||
|
@ -103,6 +103,10 @@ class NetHost(Lookup):
|
||||
class NetIn(Lookup):
|
||||
lookup_name = 'net_in'
|
||||
|
||||
def get_prep_lookup(self):
|
||||
# Don't cast the query value to a netaddr object, since it may or may not include a mask.
|
||||
return self.rhs
|
||||
|
||||
def as_sql(self, qn, connection):
|
||||
lhs, lhs_params = self.process_lhs(qn, connection)
|
||||
rhs, rhs_params = self.process_rhs(qn, connection)
|
||||
|
@ -760,7 +760,7 @@ class IPAddressAssignView(PermissionRequiredMixin, View):
|
||||
'vrf', 'tenant', 'interface__device', 'interface__virtual_machine'
|
||||
)
|
||||
# Limit to 100 results
|
||||
addresses = filters.IPAddressFilter(request.POST, addresses).qs[:100]
|
||||
addresses = filters.IPAddressFilterSet(request.POST, addresses).qs[:100]
|
||||
table = tables.IPAddressAssignTable(addresses)
|
||||
|
||||
return render(request, 'ipam/ipaddress_assign.html', {
|
||||
|
@ -12,7 +12,7 @@ from django.core.exceptions import ImproperlyConfigured
|
||||
# Environment setup
|
||||
#
|
||||
|
||||
VERSION = '2.7.0'
|
||||
VERSION = '2.7.2-dev'
|
||||
|
||||
# Hostname
|
||||
HOSTNAME = platform.node()
|
||||
|
Loading…
Reference in New Issue
Block a user