Skip to content

Commit 9458521

Browse files
Merge branch 'netbox-community:develop' into script-reload
2 parents ae6ed97 + c0ca1ea commit 9458521

File tree

16 files changed

+59
-27
lines changed

16 files changed

+59
-27
lines changed

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: NetBox version
1616
description: What version of NetBox are you currently running?
17-
placeholder: v3.0.9
17+
placeholder: v3.0.10
1818
validations:
1919
required: true
2020
- type: dropdown

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ body:
1414
attributes:
1515
label: NetBox version
1616
description: What version of NetBox are you currently running?
17-
placeholder: v3.0.9
17+
placeholder: v3.0.10
1818
validations:
1919
required: true
2020
- type: dropdown

docs/release-notes/version-3.0.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
# NetBox v3.0
22

3-
## v3.0.10 (FUTURE)
3+
## v3.0.11 (FUTURE)
4+
5+
---
6+
7+
## v3.0.10 (2021-11-12)
48

59
### Enhancements
610

711
* [#7740](https://github.com/netbox-community/netbox/issues/7740) - Add mini-DIN 8 console port type
812
* [#7760](https://github.com/netbox-community/netbox/issues/7760) - Add `vid` filter field to VLANs list
13+
* [#7767](https://github.com/netbox-community/netbox/issues/7767) - Add visual aids to interfaces table for type, enabled status
914

1015
### Bug Fixes
1116

17+
* [#7564](https://github.com/netbox-community/netbox/issues/7564) - Fix assignment of members to virtual chassis with initial position of zero
1218
* [#7701](https://github.com/netbox-community/netbox/issues/7701) - Fix conflation of assigned IP status & role in interface tables
1319
* [#7741](https://github.com/netbox-community/netbox/issues/7741) - Fix 404 when attaching multiple images in succession
1420
* [#7752](https://github.com/netbox-community/netbox/issues/7752) - Fix minimum version check under Python v3.10
1521
* [#7766](https://github.com/netbox-community/netbox/issues/7766) - Add missing outer dimension columns to rack table
16-
* [#7780](https://github.com/netbox-community/netbox/issues/7780) - Preserve mutli-line values during CSV file import
22+
* [#7780](https://github.com/netbox-community/netbox/issues/7780) - Preserve multi-line values during CSV file import
1723
* [#7783](https://github.com/netbox-community/netbox/issues/7783) - Fix indentation of locations under site view
24+
* [#7788](https://github.com/netbox-community/netbox/issues/7788) - Improve XSS mitigation in Markdown renderer
25+
* [#7791](https://github.com/netbox-community/netbox/issues/7791) - Enable sorting device bays table by installed device status
26+
* [#7802](https://github.com/netbox-community/netbox/issues/7802) - Differentiate ID and VID columns in VLANs table
27+
* [#7808](https://github.com/netbox-community/netbox/issues/7808) - Fix reference values for content type under custom field import form
28+
* [#7809](https://github.com/netbox-community/netbox/issues/7809) - Add missing export template support for various models
29+
* [#7814](https://github.com/netbox-community/netbox/issues/7814) - Fix restriction of user & group objects in GraphQL API queries
1830

1931
---
2032

netbox/dcim/forms/object_create.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,18 @@ class Meta:
117117
'name', 'domain', 'region', 'site_group', 'site', 'rack', 'members', 'initial_position', 'tags',
118118
]
119119

120+
def clean(self):
121+
if self.cleaned_data['members'] and self.cleaned_data['initial_position'] is None:
122+
raise forms.ValidationError({
123+
'initial_position': "A position must be specified for the first VC member."
124+
})
125+
120126
def save(self, *args, **kwargs):
121127
instance = super().save(*args, **kwargs)
122128

123129
# Assign VC members
124-
if instance.pk:
125-
initial_position = self.cleaned_data.get('initial_position') or 1
130+
if instance.pk and self.cleaned_data['members']:
131+
initial_position = self.cleaned_data.get('initial_position', 1)
126132
for i, member in enumerate(self.cleaned_data['members'], start=initial_position):
127133
member.virtual_chassis = instance
128134
member.vc_position = i

netbox/dcim/tables/devices.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ def get_cabletermination_row_class(record):
5353
return ''
5454

5555

56+
def get_interface_row_class(record):
57+
if not record.enabled:
58+
return 'danger'
59+
elif record.is_virtual:
60+
return 'primary'
61+
return get_cabletermination_row_class(record)
62+
63+
5664
def get_interface_state_attribute(record):
5765
"""
5866
Get interface enabled state as string to attach to <tr/> DOM element.
@@ -501,8 +509,8 @@ class Meta(DeviceComponentTable.Meta):
501509

502510
class DeviceInterfaceTable(InterfaceTable):
503511
name = tables.TemplateColumn(
504-
template_code='<i class="mdi mdi-{% if iface.mgmt_only %}wrench{% elif iface.is_lag %}drag-horizontal-variant'
505-
'{% elif iface.is_virtual %}circle{% elif iface.is_wireless %}wifi{% else %}ethernet'
512+
template_code='<i class="mdi mdi-{% if record.mgmt_only %}wrench{% elif record.is_lag %}reorder-horizontal'
513+
'{% elif record.is_virtual %}circle{% elif record.is_wireless %}wifi{% else %}ethernet'
506514
'{% endif %}"></i> <a href="{{ record.get_absolute_url }}">{{ value }}</a>',
507515
order_by=Accessor('_name'),
508516
attrs={'td': {'class': 'text-nowrap'}}
@@ -534,7 +542,7 @@ class Meta(DeviceComponentTable.Meta):
534542
'cable', 'connection', 'actions',
535543
)
536544
row_attrs = {
537-
'class': get_cabletermination_row_class,
545+
'class': get_interface_row_class,
538546
'data-name': lambda record: record.name,
539547
'data-enabled': get_interface_state_attribute,
540548
}
@@ -653,7 +661,8 @@ class DeviceBayTable(DeviceComponentTable):
653661
}
654662
)
655663
status = tables.TemplateColumn(
656-
template_code=DEVICEBAY_STATUS
664+
template_code=DEVICEBAY_STATUS,
665+
order_by=Accessor('installed_device__status')
657666
)
658667
installed_device = tables.Column(
659668
linkify=True

netbox/extras/forms/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class Meta:
7070
class ExportTemplateForm(BootstrapMixin, forms.ModelForm):
7171
content_type = ContentTypeChoiceField(
7272
queryset=ContentType.objects.all(),
73-
limit_choices_to=FeatureQuery('custom_links')
73+
limit_choices_to=FeatureQuery('export_templates')
7474
)
7575

7676
class Meta:

netbox/extras/models/customfields.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def get_for_model(self, model):
3131
return self.get_queryset().filter(content_types=content_type)
3232

3333

34-
@extras_features('webhooks')
34+
@extras_features('webhooks', 'export_templates')
3535
class CustomField(ChangeLoggedModel):
3636
content_types = models.ManyToManyField(
3737
to=ContentType,

netbox/extras/models/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from django.http import HttpResponse
1010
from django.urls import reverse
1111
from django.utils import timezone
12-
from django.utils.formats import date_format, time_format
12+
from django.utils.formats import date_format
1313
from rest_framework.utils.encoders import JSONEncoder
1414

1515
from extras.choices import *
@@ -36,7 +36,7 @@
3636
# Webhooks
3737
#
3838

39-
@extras_features('webhooks')
39+
@extras_features('webhooks', 'export_templates')
4040
class Webhook(ChangeLoggedModel):
4141
"""
4242
A Webhook defines a request that will be sent to a remote application when an object is created, updated, and/or
@@ -175,7 +175,7 @@ def render_body(self, context):
175175
# Custom links
176176
#
177177

178-
@extras_features('webhooks')
178+
@extras_features('webhooks', 'export_templates')
179179
class CustomLink(ChangeLoggedModel):
180180
"""
181181
A custom link to an external representation of a NetBox object. The link text and URL fields accept Jinja2 template
@@ -234,7 +234,7 @@ def get_absolute_url(self):
234234
# Export templates
235235
#
236236

237-
@extras_features('webhooks')
237+
@extras_features('webhooks', 'export_templates')
238238
class ExportTemplate(ChangeLoggedModel):
239239
content_type = models.ForeignKey(
240240
to=ContentType,

netbox/extras/models/tags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Tags
1515
#
1616

17-
@extras_features('webhooks')
17+
@extras_features('webhooks', 'export_templates')
1818
class Tag(ChangeLoggedModel, TagBase):
1919
color = ColorField(
2020
default=ColorChoices.COLOR_GREY

netbox/ipam/tables/vlans.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class VLANTable(BaseTable):
9393
pk = ToggleColumn()
9494
vid = tables.TemplateColumn(
9595
template_code=VLAN_LINK,
96-
verbose_name='ID'
96+
verbose_name='VID'
9797
)
9898
site = tables.Column(
9999
linkify=True

0 commit comments

Comments
 (0)