diff --git a/rdmo/projects/exports.py b/rdmo/projects/exports.py index 5b7e8192ab..e1e09df283 100644 --- a/rdmo/projects/exports.py +++ b/rdmo/projects/exports.py @@ -157,15 +157,17 @@ class RDMOXMLExport(Export): def render(self): if self.project: - content_disposition = f'filename="{self.project.title}.xml"' + content_disposition = f'attachment; filename="{self.project.title}.xml"' serializer = ProjectExportSerializer(self.project) else: - content_disposition = f'filename="{self.snapshot.title}.xml"' + content_disposition = f'attachment; filename="{self.snapshot.title}.xml"' serializer = SnapshotExportSerializer(self.snapshot) xmldata = XMLRenderer().render(serializer.data) response = HttpResponse(prettify_xml(xmldata), content_type="application/xml") + if settings.EXPORT_CONTENT_DISPOSITION == 'attachment': response['Content-Disposition'] = content_disposition + return response