Skip to content

Commit b83fcc6

Browse files
committed
Merge branch 'develop' into feature
2 parents d2fea4e + 9d09916 commit b83fcc6

File tree

26 files changed

+176
-113
lines changed

26 files changed

+176
-113
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.6.5
17+
placeholder: v3.6.6
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.6.5
17+
placeholder: v3.6.6
1818
validations:
1919
required: true
2020
- type: dropdown

docs/release-notes/version-3.6.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# NetBox v3.6
22

3-
## v3.6.6 (FUTURE)
3+
## v3.6.7 (FUTURE)
4+
5+
---
6+
7+
## v3.6.6 (2023-11-29)
8+
9+
### Enhancements
10+
11+
* [#13735](https://github.com/netbox-community/netbox/issues/13735) - Show complete region hierarchy in UI for all relevant objects
12+
13+
### Bug Fixes
14+
15+
* [#14056](https://github.com/netbox-community/netbox/issues/14056) - Record a pre-change snapshot when bulk editing objects via CSV
16+
* [#14187](https://github.com/netbox-community/netbox/issues/14187) - Raise a validation error when attempting to create a duplicate script or report
17+
* [#14199](https://github.com/netbox-community/netbox/issues/14199) - Fix jobs list for reports with a custom name
18+
* [#14239](https://github.com/netbox-community/netbox/issues/14239) - Fix CustomFieldChoiceSet search filter
19+
* [#14242](https://github.com/netbox-community/netbox/issues/14242) - Enable export templates for contact assignments
20+
* [#14299](https://github.com/netbox-community/netbox/issues/14299) - Webhook timestamps should be in proper ISO 8601 format
21+
* [#14325](https://github.com/netbox-community/netbox/issues/14325) - Fix numeric ordering of service ports
22+
* [#14339](https://github.com/netbox-community/netbox/issues/14339) - Correctly hash local user password when set via REST API
23+
* [#14343](https://github.com/netbox-community/netbox/issues/14343) - Fix ordering ASN table by ASDOT column
24+
* [#14346](https://github.com/netbox-community/netbox/issues/14346) - Fix running reports via REST API
25+
* [#14349](https://github.com/netbox-community/netbox/issues/14349) - Fix custom validation support for remote data sources
26+
* [#14363](https://github.com/netbox-community/netbox/issues/14363) - Fix bulk editing of interfaces assigned to VM with no cluster
427

528
---
629

netbox/core/models/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def ready_for_sync(self):
116116
)
117117

118118
def clean(self):
119+
super().clean()
119120

120121
# Validate data backend type
121122
if self.type and self.type not in registry['data_backends']:

netbox/core/models/files.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33

44
from django.conf import settings
5+
from django.core.exceptions import ValidationError
56
from django.db import models
67
from django.urls import reverse
78
from django.utils.translation import gettext as _
@@ -85,6 +86,14 @@ def sync_data(self):
8586
self.file_path = os.path.basename(self.data_path)
8687
self.data_file.write_to_disk(self.full_path, overwrite=True)
8788

89+
def clean(self):
90+
super().clean()
91+
92+
# Ensure that the file root and path make a unique pair
93+
if self._meta.model.objects.filter(file_root=self.file_root, file_path=self.file_path).exclude(pk=self.pk).exists():
94+
raise ValidationError(
95+
f"A {self._meta.verbose_name.lower()} with this file path already exists ({self.file_root}/{self.file_path}).")
96+
8897
def delete(self, *args, **kwargs):
8998
# Delete file from disk
9099
try:

netbox/core/models/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def trigger_webhooks(self, event):
244244
model_name=self.object_type.model,
245245
event=event,
246246
data=self.data,
247-
timestamp=str(timezone.now()),
247+
timestamp=timezone.now().isoformat(),
248248
username=self.user.username,
249249
retry=get_rq_retry()
250250
)

netbox/extras/api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def run(self, request, pk):
283283

284284
# Retrieve and run the Report. This will create a new Job.
285285
module, report_cls = self._get_report(pk)
286-
report = report_cls()
286+
report = report_cls
287287
input_serializer = serializers.ReportInputSerializer(
288288
data=request.data,
289289
context={'report': report}

netbox/extras/filtersets.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ def search(self, queryset, name, value):
121121
return queryset
122122
return queryset.filter(
123123
Q(name__icontains=value) |
124-
Q(description__icontains=value) |
125-
Q(extra_choices__contains=value)
124+
Q(description__icontains=value)
126125
)
127126

128127
def filter_by_choice(self, queryset, name, value):

netbox/extras/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ def get(self, request, module, name):
10931093
jobs = Job.objects.filter(
10941094
object_type=object_type,
10951095
object_id=module.pk,
1096-
name=report.name
1096+
name=report.class_name
10971097
)
10981098

10991099
jobs_table = JobTable(

netbox/extras/webhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def flush_webhooks(queue):
115115
event=data['event'],
116116
data=data['data'],
117117
snapshots=data['snapshots'],
118-
timestamp=str(timezone.now()),
118+
timestamp=timezone.now().isoformat(),
119119
username=data['username'],
120120
request_id=data['request_id'],
121121
retry=get_rq_retry()

netbox/ipam/tables/asn.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class ASNTable(TenancyColumnsMixin, NetBoxTable):
4848
asn_asdot = tables.Column(
4949
accessor=tables.A('asn_asdot'),
5050
linkify=True,
51+
order_by=tables.A('asn'),
5152
verbose_name=_('ASDOT')
5253
)
5354
site_count = columns.LinkedCountColumn(

netbox/netbox/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# Environment setup
2828
#
2929

30-
VERSION = '3.6.6-dev'
30+
VERSION = '3.6.7-dev'
3131

3232
# Hostname
3333
HOSTNAME = platform.node()

netbox/netbox/views/generic/bulk_views.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,10 @@ def create_and_update_objects(self, form, request):
394394
form.add_error('data', f"Row {i}: Object with ID {object_id} does not exist")
395395
raise ValidationError('')
396396

397+
# Take a snapshot for change logging
398+
if instance.pk and hasattr(instance, 'snapshot'):
399+
instance.snapshot()
400+
397401
# Instantiate the model form for the object
398402
model_form_kwargs = {
399403
'data': record,

netbox/templates/dcim/device.html

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
{% load helpers %}
66
{% load plugins %}
77
{% load i18n %}
8+
{% load mptt %}
89

910
{% block content %}
1011
<div class="row">
@@ -15,33 +16,15 @@ <h5 class="card-header">{% trans "Device" %}</h5>
1516
<table class="table table-hover attr-table">
1617
<tr>
1718
<th scope="row">{% trans "Region" %}</th>
18-
<td>
19-
{% if object.site.region %}
20-
{% for region in object.site.region.get_ancestors %}
21-
{{ region|linkify }} /
22-
{% endfor %}
23-
{{ object.site.region|linkify }}
24-
{% else %}
25-
{{ ''|placeholder }}
26-
{% endif %}
27-
</td>
19+
<td>{% nested_tree object.site.region %}</td>
2820
</tr>
2921
<tr>
3022
<th scope="row">{% trans "Site" %}</th>
3123
<td>{{ object.site|linkify }}</td>
3224
</tr>
3325
<tr>
3426
<th scope="row">{% trans "Location" %}</th>
35-
<td>
36-
{% if object.location %}
37-
{% for location in object.location.get_ancestors %}
38-
{{ location|linkify }} /
39-
{% endfor %}
40-
{{ object.location|linkify }}
41-
{% else %}
42-
{{ ''|placeholder }}
43-
{% endif %}
44-
</td>
27+
<td>{% nested_tree object.location %}</td>
4528
</tr>
4629
<tr>
4730
<th scope="row">{% trans "Rack" %}</th>

netbox/templates/dcim/rack.html

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{% load static %}
55
{% load plugins %}
66
{% load i18n %}
7+
{% load mptt %}
78

89
{% block content %}
910
<div class="row">
@@ -15,26 +16,18 @@ <h5 class="card-header">
1516
<div class="card-body">
1617
<table class="table table-hover attr-table">
1718
<tr>
18-
<th scope="row">{% trans "Site" %}</th>
19+
<th scope="row">{% trans "Region" %}</th>
1920
<td>
20-
{% if object.site.region %}
21-
{{ object.site.region|linkify }} /
22-
{% endif %}
23-
{{ object.site|linkify }}
21+
{% nested_tree object.site.region %}
2422
</td>
2523
</tr>
24+
<tr>
25+
<th scope="row">{% trans "Site" %}</th>
26+
<td>{{ object.site|linkify }}</td>
27+
</tr>
2628
<tr>
2729
<th scope="row">{% trans "Location" %}</th>
28-
<td>
29-
{% if object.location %}
30-
{% for location in object.location.get_ancestors %}
31-
{{ location|linkify }} /
32-
{% endfor %}
33-
{{ object.location|linkify }}
34-
{% else %}
35-
{{ ''|placeholder }}
36-
{% endif %}
37-
</td>
30+
<td>{% nested_tree object.location %}</td>
3831
</tr>
3932
<tr>
4033
<th scope="row">{% trans "Facility ID" %}</th>

netbox/templates/dcim/rackreservation.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
{% load static %}
55
{% load plugins %}
66
{% load i18n %}
7+
{% load mptt %}
78

89
{% block breadcrumbs %}
910
{{ block.super }}
@@ -20,25 +21,24 @@ <h5 class="card-header">
2021
</h5>
2122
<div class="card-body">
2223
<table class="table table-hover attr-table">
23-
{% with rack=object.rack %}
24-
<tr>
25-
<th scope="row">{% trans "Site" %}</th>
26-
<td>
27-
{% if rack.site.region %}
28-
{{ rack.site.region|linkify }} /
29-
{% endif %}
30-
{{ rack.site|linkify }}
31-
</td>
32-
</tr>
33-
<tr>
34-
<th scope="row">{% trans "Location" %}</th>
35-
<td>{{ rack.location|linkify|placeholder }}</td>
36-
</tr>
37-
<tr>
38-
<th scope="row">{% trans "Rack" %}</th>
39-
<td>{{ rack|linkify }}</td>
40-
</tr>
41-
{% endwith %}
24+
<tr>
25+
<th scope="row">{% trans "Region" %}</th>
26+
<td>
27+
{% nested_tree object.rack.site.region %}
28+
</td>
29+
</tr>
30+
<tr>
31+
<th scope="row">{% trans "Site" %}</th>
32+
<td>{{ object.rack.site|linkify }}</td>
33+
</tr>
34+
<tr>
35+
<th scope="row">{% trans "Location" %}</th>
36+
<td>{{ object.rack.location|linkify|placeholder }}</td>
37+
</tr>
38+
<tr>
39+
<th scope="row">{% trans "Rack" %}</th>
40+
<td>{{ object.rack|linkify }}</td>
41+
</tr>
4242
</table>
4343
</div>
4444
</div>

netbox/templates/dcim/site.html

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{% load plugins %}
44
{% load tz %}
55
{% load i18n %}
6+
{% load mptt %}
67

78
{% block breadcrumbs %}
89
{{ block.super }}
@@ -29,27 +30,13 @@ <h5 class="card-header">{% trans "Site" %}</h5>
2930
<tr>
3031
<th scope="row">{% trans "Region" %}</th>
3132
<td>
32-
{% if object.region %}
33-
{% for region in object.region.get_ancestors %}
34-
{{ region|linkify }} /
35-
{% endfor %}
36-
{{ object.region|linkify }}
37-
{% else %}
38-
{{ ''|placeholder }}
39-
{% endif %}
33+
{% nested_tree object.region %}
4034
</td>
4135
</tr>
4236
<tr>
4337
<th scope="row">{% trans "Group" %}</th>
4438
<td>
45-
{% if object.group %}
46-
{% for group in object.group.get_ancestors %}
47-
{{ group|linkify }} /
48-
{% endfor %}
49-
{{ object.group|linkify }}
50-
{% else %}
51-
{{ ''|placeholder }}
52-
{% endif %}
39+
{% nested_tree object.group %}
5340
</td>
5441
</tr>
5542
<tr>

netbox/templates/ipam/prefix.html

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{% load helpers %}
44
{% load plugins %}
55
{% load i18n %}
6+
{% load mptt %}
67

78
{% block content %}
89
<div class="row">
@@ -44,18 +45,17 @@ <h5 class="card-header">{% trans "Prefix" %}</h5>
4445
{% endif %}
4546
</td>
4647
</tr>
48+
{% if object.site.region %}
49+
<tr>
50+
<th scope="row">{% trans "Region" %}</th>
51+
<td>
52+
{% nested_tree object.site.region %}
53+
</td>
54+
</tr>
55+
{% endif %}
4756
<tr>
4857
<th scope="row">{% trans "Site" %}</th>
49-
<td>
50-
{% if object.site %}
51-
{% if object.site.region %}
52-
{{ object.site.region|linkify }} /
53-
{% endif %}
54-
{{ object.site|linkify }}
55-
{% else %}
56-
{{ ''|placeholder }}
57-
{% endif %}
58-
</td>
58+
<td>{{ object.site|linkify|placeholder }}</td>
5959
</tr>
6060
<tr>
6161
<th scope="row">{% trans "VLAN" %}</th>

0 commit comments

Comments
 (0)