diff --git a/ckanext/recombinant/views.py b/ckanext/recombinant/views.py index a5855ad..cf86441 100644 --- a/ckanext/recombinant/views.py +++ b/ckanext/recombinant/views.py @@ -203,11 +203,11 @@ def record_fail(err): ) -def _xlsx_response_headers(): +def _xltx_response_headers(): """ Returns tuple of content type and disposition type. - If the request is from MS Edge user agent, we force the XLSX + If the request is from MS Edge user agent, we force the XLTX download to prevent Edge from cowboying into Office Apps Online """ content_type = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' @@ -226,7 +226,7 @@ def _xlsx_response_headers(): return content_type, disposition_type -@recombinant.route('/recombinant-template/__.xlsx', methods=['GET', 'POST']) +@recombinant.route('/recombinant-template/__.xltx', methods=['GET', 'POST']) def template(dataset_type, lang, owner_org): """ @@ -282,10 +282,10 @@ def template(dataset_type, lang, owner_org): blob = BytesIO() book.save(blob) response = Response(blob.getvalue()) - content_type, disposition_type = _xlsx_response_headers() + content_type, disposition_type = _xltx_response_headers() response.headers['Content-Type'] = content_type response.headers['Content-Disposition'] = ( - '{}; filename="{}_{}_{}.xlsx"'.format( + '{}; filename="{}_{}_{}.xltx"'.format( disposition_type, dataset['owner_org'], lang, @@ -303,7 +303,7 @@ def _data_dictionary(dataset_type, published_resource=False): blob = BytesIO() book.save(blob) response = Response(blob.getvalue()) - content_type, disposition_type = _xlsx_response_headers() + content_type, disposition_type = _xltx_response_headers() response.headers['Content-Type'] = content_type response.headers['Content-Disposition'] = '{}; filename="{}.xlsx"'.format( disposition_type,