Skip to content

Commit

Permalink
Merge pull request #1398 from digitalocean/develop
Browse files Browse the repository at this point in the history
Release v2.1.2
  • Loading branch information
jeremystretch authored Aug 4, 2017
2 parents 9cc03aa + a7d5fb5 commit fa7b728
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 89 deletions.
11 changes: 2 additions & 9 deletions netbox/dcim/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,20 +448,13 @@ class Meta:
def search(self, queryset, name, value):
if not value.strip():
return queryset
qs_filter = (
return queryset.filter(
Q(name__icontains=value) |
Q(serial__icontains=value.strip()) |
Q(inventory_items__serial__icontains=value.strip()) |
Q(asset_tag=value.strip()) |
Q(comments__icontains=value)
)
# If the query value looks like a MAC address, search interfaces as well.
try:
mac = EUI(value.strip())
qs_filter |= Q(interfaces__mac_address=mac)
except AddrFormatError:
pass
return queryset.filter(qs_filter).distinct()
).distinct()

def _mac_address(self, queryset, name, value):
value = value.strip()
Expand Down
6 changes: 5 additions & 1 deletion netbox/ipam/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ def available_ips(self, request, pk=None):
limit = min(limit, settings.MAX_PAGE_SIZE)

# Calculate available IPs within the prefix
ip_list = list(prefix.get_available_ips())[:limit]
ip_list = []
for index, ip in enumerate(prefix.get_available_ips(), start=1):
ip_list.append(ip)
if index == limit:
break
serializer = serializers.AvailableIPSerializer(ip_list, many=True, context={
'request': request,
'prefix': prefix.prefix,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-03 19:37
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('ipam', '0017_ipaddress_roles'),
]

operations = [
migrations.AlterUniqueTogether(
name='service',
unique_together=set([]),
),
]
1 change: 0 additions & 1 deletion netbox/ipam/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,6 @@ class Service(CreatedUpdatedModel):

class Meta:
ordering = ['device', 'protocol', 'port']
unique_together = ['device', 'protocol', 'port']

def __str__(self):
return '{} ({}/{})'.format(self.name, self.port, self.get_protocol_display())
2 changes: 1 addition & 1 deletion netbox/netbox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)


VERSION = '2.1.1'
VERSION = '2.1.2'

# Import required configuration parameters
ALLOWED_HOSTS = DATABASE = SECRET_KEY = None
Expand Down
5 changes: 5 additions & 0 deletions netbox/project-static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ footer p {
}
}

/* Navigation menu */
li.subnav > a {
padding-left: 30px;
}

/* Forms */
label {
font-weight: normal;
Expand Down
154 changes: 77 additions & 77 deletions netbox/templates/_base.html

Large diffs are not rendered by default.

0 comments on commit fa7b728

Please sign in to comment.