mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
gdprdatasubect
committed by
Jeremy Stretch
parent
6f08c4a4be
commit
fbc23424a6
@ -301,7 +301,7 @@ class ExportTemplate(CloningMixin, ExportTemplatesMixin, WebhooksMixin, ChangeLo
|
|||||||
max_length=50,
|
max_length=50,
|
||||||
blank=True,
|
blank=True,
|
||||||
verbose_name='MIME type',
|
verbose_name='MIME type',
|
||||||
help_text=_('Defaults to <code>text/plain</code>')
|
help_text=_('Defaults to <code>text/plain; charset=utf-8</code>')
|
||||||
)
|
)
|
||||||
file_extension = models.CharField(
|
file_extension = models.CharField(
|
||||||
max_length=15,
|
max_length=15,
|
||||||
@ -357,7 +357,7 @@ class ExportTemplate(CloningMixin, ExportTemplatesMixin, WebhooksMixin, ChangeLo
|
|||||||
Render the template to an HTTP response, delivered as a named file attachment
|
Render the template to an HTTP response, delivered as a named file attachment
|
||||||
"""
|
"""
|
||||||
output = self.render(queryset)
|
output = self.render(queryset)
|
||||||
mime_type = 'text/plain' if not self.mime_type else self.mime_type
|
mime_type = 'text/plain; charset=utf-8' if not self.mime_type else self.mime_type
|
||||||
|
|
||||||
# Build the response
|
# Build the response
|
||||||
response = HttpResponse(output, content_type=mime_type)
|
response = HttpResponse(output, content_type=mime_type)
|
||||||
|
Reference in New Issue
Block a user