Skip to content

Commit 0b70555

Browse files
committed
Fixes #7809: Add missing export template support for various models
1 parent a799094 commit 0b70555

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

docs/release-notes/version-3.0.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* [#7788](https://github.com/netbox-community/netbox/issues/7788) - Improve XSS mitigation in Markdown renderer
2121
* [#7791](https://github.com/netbox-community/netbox/issues/7791) - Enable sorting device bays table by installed device status
2222
* [#7802](https://github.com/netbox-community/netbox/issues/7802) - Differentiate ID and VID columns in VLANs table
23+
* [#7809](https://github.com/netbox-community/netbox/issues/7809) - Add missing export template support for various models
2324

2425
---
2526

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

0 commit comments

Comments
 (0)