From 1e160fd9e9429607b9c5f21f11a0fa307bb60481 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 4 Apr 2019 12:43:14 -0400 Subject: [PATCH 01/12] Fixes #3041: Fix form widget for bulk cable label update --- CHANGELOG.md | 8 ++++++++ netbox/dcim/forms.py | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd2e02e57..08424125a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +v2.5.10 (FUTURE) + +## Bug Fixes + +* [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update + +--- + v2.5.9 (2019-04-01) ## Enhancements diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index 06cc7ffe2..c81564b0c 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -2706,12 +2706,12 @@ class CableBulkEditForm(BootstrapMixin, BulkEditForm): status = forms.ChoiceField( choices=add_blank_choice(CONNECTION_STATUS_CHOICES), required=False, + widget=StaticSelect2(), initial='' ) label = forms.CharField( max_length=100, - required=False, - widget=StaticSelect2() + required=False ) color = forms.CharField( max_length=6, From 858be6d21666b90bd84efe4750cff83979105cf6 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 4 Apr 2019 15:00:59 -0400 Subject: [PATCH 02/12] Fixes #3039: Fix exception when retrieving change object for a component template via API --- CHANGELOG.md | 1 + netbox/extras/api/serializers.py | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08424125a..5579f649d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ v2.5.10 (FUTURE) ## Bug Fixes +* [#3039](https://github.com/digitalocean/netbox/issues/3039) - Fix exception when retrieving change object for a component template via API * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update --- diff --git a/netbox/extras/api/serializers.py b/netbox/extras/api/serializers.py index 6e860a8c7..981d649fb 100644 --- a/netbox/extras/api/serializers.py +++ b/netbox/extras/api/serializers.py @@ -16,7 +16,8 @@ from tenancy.api.nested_serializers import NestedTenantSerializer, NestedTenantG from tenancy.models import Tenant, TenantGroup from users.api.nested_serializers import NestedUserSerializer from utilities.api import ( - ChoiceField, ContentTypeField, get_serializer_for_model, SerializedPKRelatedField, ValidatedModelSerializer, + ChoiceField, ContentTypeField, get_serializer_for_model, SerializerNotFound, SerializedPKRelatedField, + ValidatedModelSerializer, ) from .nested_serializers import * @@ -235,9 +236,14 @@ class ObjectChangeSerializer(serializers.ModelSerializer): """ if obj.changed_object is None: return None - serializer = get_serializer_for_model(obj.changed_object, prefix='Nested') - if serializer is None: + + try: + serializer = get_serializer_for_model(obj.changed_object, prefix='Nested') + except SerializerNotFound: return obj.object_repr - context = {'request': self.context['request']} + context = { + 'request': self.context['request'] + } data = serializer(obj.changed_object, context=context).data + return data From 74c03e32957ba4a185c75c94d9c243803bebf9cb Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 4 Apr 2019 15:07:41 -0400 Subject: [PATCH 03/12] Fixes #3036: DCIM interfaces API endpoint should not include VM interfaces --- CHANGELOG.md | 1 + netbox/dcim/api/views.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5579f649d..d959522aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ v2.5.10 (FUTURE) ## Bug Fixes +* [#3036](https://github.com/digitalocean/netbox/issues/3036) - DCIM interfaces API endpoint should not include VM interfaces * [#3039](https://github.com/digitalocean/netbox/issues/3039) - Fix exception when retrieving change object for a component template via API * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update diff --git a/netbox/dcim/api/views.py b/netbox/dcim/api/views.py index db8cb87a9..8964e7fcb 100644 --- a/netbox/dcim/api/views.py +++ b/netbox/dcim/api/views.py @@ -419,7 +419,9 @@ class PowerOutletViewSet(CableTraceMixin, ModelViewSet): class InterfaceViewSet(CableTraceMixin, ModelViewSet): - queryset = Interface.objects.select_related( + queryset = Interface.objects.filter( + device__isnull=False + ).select_related( 'device', '_connected_interface', '_connected_circuittermination', 'cable' ).prefetch_related( 'ip_addresses', 'tags' From 090efde21a2d62b170aa10e9c46d6ebe0034de31 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 4 Apr 2019 16:19:20 -0400 Subject: [PATCH 04/12] Fixes #3044: Ignore site/rack fields when connecting a new cable via device search --- CHANGELOG.md | 1 + netbox/project-static/js/forms.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d959522aa..6c703d032 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ v2.5.10 (FUTURE) * [#3036](https://github.com/digitalocean/netbox/issues/3036) - DCIM interfaces API endpoint should not include VM interfaces * [#3039](https://github.com/digitalocean/netbox/issues/3039) - Fix exception when retrieving change object for a component template via API * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update +* [#3044](https://github.com/digitalocean/netbox/issues/3044) - Ignore site/rack fields when connecting a new cable via device search --- diff --git a/netbox/project-static/js/forms.js b/netbox/project-static/js/forms.js index 3c1ed5a2a..96d59ace5 100644 --- a/netbox/project-static/js/forms.js +++ b/netbox/project-static/js/forms.js @@ -156,11 +156,12 @@ $(document).ready(function() { filter_for_elements.each(function(index, filter_for_element) { var param_name = $(filter_for_element).attr(attr_name); var is_nullable = $(filter_for_element).attr("nullable"); + var is_visible = $(filter_for_element).is(":visible"); var value = $(filter_for_element).val(); - if (param_name && value) { + if (param_name && is_visible && value) { parameters[param_name] = value; - } else if (param_name && is_nullable) { + } else if (param_name && is_visible && is_nullable) { parameters[param_name] = "null"; } }); From 1b389d662b8cf730ab3f11ac6a9e976ed4ffaa1b Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Thu, 4 Apr 2019 17:34:36 -0400 Subject: [PATCH 05/12] Fixes #3046: Fix exception at reports API endpoint --- CHANGELOG.md | 1 + netbox/netbox/api.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c703d032..60eb7e37d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ v2.5.10 (FUTURE) * [#3039](https://github.com/digitalocean/netbox/issues/3039) - Fix exception when retrieving change object for a component template via API * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update * [#3044](https://github.com/digitalocean/netbox/issues/3044) - Ignore site/rack fields when connecting a new cable via device search +* [#3046](https://github.com/digitalocean/netbox/issues/3046) - Fix exception at reports API endpoint --- diff --git a/netbox/netbox/api.py b/netbox/netbox/api.py index 60c493be7..d8592f341 100644 --- a/netbox/netbox/api.py +++ b/netbox/netbox/api.py @@ -147,18 +147,18 @@ class OptionalLimitOffsetPagination(LimitOffsetPagination): # Miscellaneous # -def get_view_name(view_cls, suffix=None): +def get_view_name(view, suffix=None): """ Derive the view name from its associated model, if it has one. Fall back to DRF's built-in `get_view_name`. """ - if hasattr(view_cls, 'queryset'): + if hasattr(view, 'queryset'): # Determine the model name from the queryset. - name = view_cls.queryset.model._meta.verbose_name + name = view.queryset.model._meta.verbose_name name = ' '.join([w[0].upper() + w[1:] for w in name.split()]) # Capitalize each word else: # Replicate DRF's built-in behavior. - name = view_cls.__name__ + name = view.__class__.__name__ name = formatting.remove_trailing_string(name, 'View') name = formatting.remove_trailing_string(name, 'ViewSet') name = formatting.camelcase_to_spaces(name) From e556c785995e2de06a95b479a302b44bea0bdab9 Mon Sep 17 00:00:00 2001 From: dansheps Date: Fri, 5 Apr 2019 09:36:56 -0500 Subject: [PATCH 06/12] Fixes #3047: Fix exception string for invalid MAC Address format --- netbox/dcim/fields.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/netbox/dcim/fields.py b/netbox/dcim/fields.py index 8d4bfba35..b91fd4244 100644 --- a/netbox/dcim/fields.py +++ b/netbox/dcim/fields.py @@ -2,6 +2,7 @@ from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models from netaddr import AddrFormatError, EUI, mac_unix_expanded +import pprint class ASNField(models.BigIntegerField): @@ -31,7 +32,7 @@ class MACAddressField(models.Field): try: return EUI(value, version=48, dialect=mac_unix_expanded_uppercase) except AddrFormatError as e: - raise ValidationError(e) + raise ValidationError("Invalid MAC address format: {}".format(value)) def db_type(self, connection): return 'macaddr' From c03241320138fe7b545b43514e93615473270b0d Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Fri, 5 Apr 2019 09:39:04 -0500 Subject: [PATCH 07/12] Remove unneeded import from testing. --- netbox/dcim/fields.py | 1 - 1 file changed, 1 deletion(-) diff --git a/netbox/dcim/fields.py b/netbox/dcim/fields.py index b91fd4244..9624ce0a3 100644 --- a/netbox/dcim/fields.py +++ b/netbox/dcim/fields.py @@ -2,7 +2,6 @@ from django.core.exceptions import ValidationError from django.core.validators import MinValueValidator, MaxValueValidator from django.db import models from netaddr import AddrFormatError, EUI, mac_unix_expanded -import pprint class ASNField(models.BigIntegerField): From 7f6d79362ee057edd2c9f4d1fd11a40ee1b5db43 Mon Sep 17 00:00:00 2001 From: dansheps Date: Fri, 5 Apr 2019 09:46:15 -0500 Subject: [PATCH 08/12] Fix virtualization test and add to changelog --- CHANGELOG.md | 1 + netbox/virtualization/tests/test_api.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 60eb7e37d..bd36ecc9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ v2.5.10 (FUTURE) * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update * [#3044](https://github.com/digitalocean/netbox/issues/3044) - Ignore site/rack fields when connecting a new cable via device search * [#3046](https://github.com/digitalocean/netbox/issues/3046) - Fix exception at reports API endpoint +* [#3047](https://github.com/digitalocean/netbox/issues/3047) - Fix exception when writing mac address for an interface via API --- diff --git a/netbox/virtualization/tests/test_api.py b/netbox/virtualization/tests/test_api.py index 91792f8fb..328484a89 100644 --- a/netbox/virtualization/tests/test_api.py +++ b/netbox/virtualization/tests/test_api.py @@ -622,7 +622,7 @@ class InterfaceTest(APITestCase): def test_delete_interface(self): - url = reverse('dcim-api:interface-detail', kwargs={'pk': self.interface1.pk}) + url = reverse('virtualization-api:interface-detail', kwargs={'pk': self.interface1.pk}) response = self.client.delete(url, **self.header) self.assertHttpStatus(response, status.HTTP_204_NO_CONTENT) From 6f8591f76994f2b943e3c8fd9d1ab02c5d62ddd5 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 8 Apr 2019 12:20:24 -0400 Subject: [PATCH 09/12] Closes #3052: Add Jinja2 support for export templates --- CHANGELOG.md | 4 ++ netbox/extras/api/serializers.py | 9 ++++- netbox/extras/api/views.py | 1 + netbox/extras/constants.py | 8 ++++ netbox/extras/filters.py | 2 +- netbox/extras/forms.py | 3 +- .../0018_exporttemplate_add_jinja2.py | 27 ++++++++++++++ netbox/extras/models.py | 37 ++++++++++++++++--- requirements.txt | 1 + 9 files changed, 82 insertions(+), 10 deletions(-) create mode 100644 netbox/extras/migrations/0018_exporttemplate_add_jinja2.py diff --git a/CHANGELOG.md b/CHANGELOG.md index bd36ecc9d..4fec2d5ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ v2.5.10 (FUTURE) +## Enhancements + +* [#3052](https://github.com/digitalocean/netbox/issues/3052) - Add Jinja2 support for export templates + ## Bug Fixes * [#3036](https://github.com/digitalocean/netbox/issues/3036) - DCIM interfaces API endpoint should not include VM interfaces diff --git a/netbox/extras/api/serializers.py b/netbox/extras/api/serializers.py index 981d649fb..cca783bc6 100644 --- a/netbox/extras/api/serializers.py +++ b/netbox/extras/api/serializers.py @@ -55,10 +55,17 @@ class RenderedGraphSerializer(serializers.ModelSerializer): # class ExportTemplateSerializer(ValidatedModelSerializer): + template_language = ChoiceField( + choices=TEMPLATE_LANGUAGE_CHOICES, + default=TEMPLATE_LANGUAGE_JINJA2 + ) class Meta: model = ExportTemplate - fields = ['id', 'content_type', 'name', 'description', 'template_code', 'mime_type', 'file_extension'] + fields = [ + 'id', 'content_type', 'name', 'description', 'template_language', 'template_code', 'mime_type', + 'file_extension', + ] # diff --git a/netbox/extras/api/views.py b/netbox/extras/api/views.py index ec30c6a66..30ef826e8 100644 --- a/netbox/extras/api/views.py +++ b/netbox/extras/api/views.py @@ -23,6 +23,7 @@ from . import serializers class ExtrasFieldChoicesViewSet(FieldChoicesViewSet): fields = ( + (ExportTemplate, ['template_language']), (Graph, ['type']), (ObjectChange, ['action']), ) diff --git a/netbox/extras/constants.py b/netbox/extras/constants.py index 51fc398f7..13c15cbba 100644 --- a/netbox/extras/constants.py +++ b/netbox/extras/constants.py @@ -56,6 +56,14 @@ EXPORTTEMPLATE_MODELS = [ 'cluster', 'virtualmachine', # Virtualization ] +# ExportTemplate language choices +TEMPLATE_LANGUAGE_DJANGO = 10 +TEMPLATE_LANGUAGE_JINJA2 = 20 +TEMPLATE_LANGUAGE_CHOICES = ( + (TEMPLATE_LANGUAGE_DJANGO, 'Django'), + (TEMPLATE_LANGUAGE_JINJA2, 'Jinja2'), +) + # Topology map types TOPOLOGYMAP_TYPE_NETWORK = 1 TOPOLOGYMAP_TYPE_CONSOLE = 2 diff --git a/netbox/extras/filters.py b/netbox/extras/filters.py index d0a801b48..d5457a5a6 100644 --- a/netbox/extras/filters.py +++ b/netbox/extras/filters.py @@ -82,7 +82,7 @@ class ExportTemplateFilter(django_filters.FilterSet): class Meta: model = ExportTemplate - fields = ['content_type', 'name'] + fields = ['content_type', 'name', 'template_language'] class TagFilter(django_filters.FilterSet): diff --git a/netbox/extras/forms.py b/netbox/extras/forms.py index b48482c93..54eee0c5c 100644 --- a/netbox/extras/forms.py +++ b/netbox/extras/forms.py @@ -4,7 +4,6 @@ from django import forms from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist -from mptt.forms import TreeNodeMultipleChoiceField from taggit.forms import TagField from taggit.models import Tag @@ -12,7 +11,7 @@ from dcim.models import DeviceRole, Platform, Region, Site from tenancy.models import Tenant, TenantGroup from utilities.forms import ( add_blank_choice, APISelectMultiple, BootstrapMixin, BulkEditForm, BulkEditNullBooleanSelect, ContentTypeSelect, - FilterChoiceField, FilterTreeNodeMultipleChoiceField, LaxURLField, JSONField, SlugField, + FilterChoiceField, LaxURLField, JSONField, SlugField, ) from .constants import ( CF_FILTER_DISABLED, CF_TYPE_BOOLEAN, CF_TYPE_DATE, CF_TYPE_INTEGER, CF_TYPE_SELECT, CF_TYPE_URL, diff --git a/netbox/extras/migrations/0018_exporttemplate_add_jinja2.py b/netbox/extras/migrations/0018_exporttemplate_add_jinja2.py new file mode 100644 index 000000000..1177ac2fb --- /dev/null +++ b/netbox/extras/migrations/0018_exporttemplate_add_jinja2.py @@ -0,0 +1,27 @@ +# Generated by Django 2.1.7 on 2019-04-08 14:49 + +from django.db import migrations, models + + +def set_template_language(apps, schema_editor): + """ + Set the language for all existing ExportTemplates to Django (Jinja2 is the default for new ExportTemplates). + """ + ExportTemplate = apps.get_model('extras', 'ExportTemplate') + ExportTemplate.objects.update(template_language=10) + + +class Migration(migrations.Migration): + + dependencies = [ + ('extras', '0017_exporttemplate_mime_type_length'), + ] + + operations = [ + migrations.AddField( + model_name='exporttemplate', + name='template_language', + field=models.PositiveSmallIntegerField(default=20), + ), + migrations.RunPython(set_template_language), + ] diff --git a/netbox/extras/models.py b/netbox/extras/models.py index ad31c3821..da8f09a50 100644 --- a/netbox/extras/models.py +++ b/netbox/extras/models.py @@ -1,7 +1,6 @@ from collections import OrderedDict from datetime import date -import graphviz from django.contrib.auth.models import User from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType @@ -12,6 +11,8 @@ from django.db.models import F, Q from django.http import HttpResponse from django.template import Template, Context from django.urls import reverse +import graphviz +from jinja2 import Environment from dcim.constants import CONNECTION_STATUS_CONNECTED from utilities.utils import deepmerge, foreground_color @@ -355,6 +356,10 @@ class ExportTemplate(models.Model): max_length=200, blank=True ) + template_language = models.PositiveSmallIntegerField( + choices=TEMPLATE_LANGUAGE_CHOICES, + default=TEMPLATE_LANGUAGE_JINJA2 + ) template_code = models.TextField() mime_type = models.CharField( max_length=50, @@ -374,16 +379,36 @@ class ExportTemplate(models.Model): def __str__(self): return '{}: {}'.format(self.content_type, self.name) + def render(self, queryset): + """ + Render the contents of the template. + """ + context = { + 'queryset': queryset + } + + if self.template_language == TEMPLATE_LANGUAGE_DJANGO: + template = Template(self.template_code) + output = template.render(Context(context)) + + elif self.template_language == TEMPLATE_LANGUAGE_JINJA2: + template = Environment().from_string(source=self.template_code) + output = template.render(**context) + + else: + return None + + # Replace CRLF-style line terminators + output = output.replace('\r\n', '\n') + + return output + def render_to_response(self, queryset): """ Render the template to an HTTP response, delivered as a named file attachment """ - template = Template(self.template_code) + output = self.render(queryset) mime_type = 'text/plain' if not self.mime_type else self.mime_type - output = template.render(Context({'queryset': queryset})) - - # Replace CRLF-style line terminators - output = output.replace('\r\n', '\n') # Build the response response = HttpResponse(output, content_type=mime_type) diff --git a/requirements.txt b/requirements.txt index 49e7cf39e..f65328ecd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,6 +10,7 @@ django-timezone-field==3.0 djangorestframework==3.9.0 drf-yasg[validation]==1.14.0 graphviz==0.10.1 +Jinja2==2.10 Markdown==2.6.11 netaddr==0.7.19 Pillow==5.3.0 From 9a91bdbdb2300799420a38de1f7fd3c50587a831 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 8 Apr 2019 14:10:55 -0400 Subject: [PATCH 10/12] Fixes #2937: Redirect to list view after editing an object from list view --- CHANGELOG.md | 1 + netbox/circuits/tables.py | 2 +- netbox/dcim/tables.py | 16 ++++++++-------- netbox/ipam/tables.py | 6 +++--- netbox/secrets/tables.py | 2 +- netbox/tenancy/tables.py | 2 +- netbox/virtualization/tables.py | 4 ++-- 7 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fec2d5ec..a0d243dab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ v2.5.10 (FUTURE) ## Bug Fixes +* [#2937](https://github.com/digitalocean/netbox/issues/2937) - Redirect to list view after editing an object from list view * [#3036](https://github.com/digitalocean/netbox/issues/3036) - DCIM interfaces API endpoint should not include VM interfaces * [#3039](https://github.com/digitalocean/netbox/issues/3039) - Fix exception when retrieving change object for a component template via API * [#3041](https://github.com/digitalocean/netbox/issues/3041) - Fix form widget for bulk cable label update diff --git a/netbox/circuits/tables.py b/netbox/circuits/tables.py index 1cddeffb2..60b6a7f7c 100644 --- a/netbox/circuits/tables.py +++ b/netbox/circuits/tables.py @@ -11,7 +11,7 @@ CIRCUITTYPE_ACTIONS = """ {% if perms.circuit.change_circuittype %} - + {% endif %} """ diff --git a/netbox/dcim/tables.py b/netbox/dcim/tables.py index 436b9053d..dd1f4f5f1 100644 --- a/netbox/dcim/tables.py +++ b/netbox/dcim/tables.py @@ -44,7 +44,7 @@ REGION_ACTIONS = """ {% if perms.dcim.change_region %} - + {% endif %} """ @@ -56,7 +56,7 @@ RACKGROUP_ACTIONS = """ {% if perms.dcim.change_rackgroup %} - + {% endif %} @@ -67,7 +67,7 @@ RACKROLE_ACTIONS = """ {% if perms.dcim.change_rackrole %} - + {% endif %} """ @@ -88,7 +88,7 @@ RACKRESERVATION_ACTIONS = """ {% if perms.dcim.change_rackreservation %} - + {% endif %} """ @@ -97,7 +97,7 @@ MANUFACTURER_ACTIONS = """ {% if perms.dcim.change_manufacturer %} - + {% endif %} """ @@ -106,7 +106,7 @@ DEVICEROLE_ACTIONS = """ {% if perms.dcim.change_devicerole %} - + {% endif %} """ @@ -131,7 +131,7 @@ PLATFORM_ACTIONS = """ {% if perms.dcim.change_platform %} - + {% endif %} """ @@ -168,7 +168,7 @@ VIRTUALCHASSIS_ACTIONS = """ {% if perms.dcim.change_virtualchassis %} - + {% endif %} """ diff --git a/netbox/ipam/tables.py b/netbox/ipam/tables.py index 3d46452b2..fb48dda24 100644 --- a/netbox/ipam/tables.py +++ b/netbox/ipam/tables.py @@ -30,7 +30,7 @@ RIR_ACTIONS = """ {% if perms.ipam.change_rir %} - + {% endif %} """ @@ -52,7 +52,7 @@ ROLE_ACTIONS = """ {% if perms.ipam.change_role %} - + {% endif %} """ @@ -152,7 +152,7 @@ VLANGROUP_ACTIONS = """ {% endif %} {% endwith %} {% if perms.ipam.change_vlangroup %} - + {% endif %} """ diff --git a/netbox/secrets/tables.py b/netbox/secrets/tables.py index a547ef4f8..1f937f54b 100644 --- a/netbox/secrets/tables.py +++ b/netbox/secrets/tables.py @@ -8,7 +8,7 @@ SECRETROLE_ACTIONS = """ {% if perms.secrets.change_secretrole %} - + {% endif %} """ diff --git a/netbox/tenancy/tables.py b/netbox/tenancy/tables.py index 2938a4aae..884bdc3df 100644 --- a/netbox/tenancy/tables.py +++ b/netbox/tenancy/tables.py @@ -8,7 +8,7 @@ TENANTGROUP_ACTIONS = """ {% if perms.tenancy.change_tenantgroup %} - + {% endif %} """ diff --git a/netbox/virtualization/tables.py b/netbox/virtualization/tables.py index f6cb06abd..6034dd8dc 100644 --- a/netbox/virtualization/tables.py +++ b/netbox/virtualization/tables.py @@ -11,7 +11,7 @@ CLUSTERTYPE_ACTIONS = """ {% if perms.virtualization.change_clustertype %} - + {% endif %} """ @@ -20,7 +20,7 @@ CLUSTERGROUP_ACTIONS = """ {% if perms.virtualization.change_clustergroup %} - + {% endif %} """ From a8d20e13a8099a689aecd2e2bae9331fe2bd691d Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 8 Apr 2019 14:19:37 -0400 Subject: [PATCH 11/12] Release v2.5.10 --- CHANGELOG.md | 2 +- netbox/netbox/settings.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0d243dab..a19bc9870 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -v2.5.10 (FUTURE) +v2.5.10 (2019-04-08) ## Enhancements diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 471b6acb0..462adbbb0 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -22,7 +22,7 @@ except ImportError: ) -VERSION = '2.5.10-dev' +VERSION = '2.5.10' BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) From 8d79353d9bd988828fbd6592b7bd25a9289136ec Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 8 Apr 2019 14:30:06 -0400 Subject: [PATCH 12/12] Post-release version bump --- netbox/netbox/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/netbox/settings.py b/netbox/netbox/settings.py index 462adbbb0..da429823b 100644 --- a/netbox/netbox/settings.py +++ b/netbox/netbox/settings.py @@ -22,7 +22,7 @@ except ImportError: ) -VERSION = '2.5.10' +VERSION = '2.5.11-dev' BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))