does not show the ODS button if the visualization is not valid (fixes #21457)
This commit is contained in:
parent
efe34f41c9
commit
2f2b3166cb
|
@ -26,7 +26,9 @@
|
|||
{% block content %}
|
||||
<form class="cube-form" method="post" action=".">
|
||||
{% csrf_token %}
|
||||
<input type="submit" value="ODS" name="ods" id="ods"/>
|
||||
{% if visualization %}
|
||||
<input type="submit" value="ODS" name="ods" id="ods"/>
|
||||
{% endif %}
|
||||
<h3>Représentation</h3>
|
||||
{% include "bijoe/field.html" with field=form.representation %}
|
||||
<h3>Répétition</h3>
|
||||
|
|
|
@ -83,6 +83,8 @@ class CubeMixin(object):
|
|||
|
||||
class ODSMixin(object):
|
||||
def ods(self, visualization):
|
||||
if not self.visualization:
|
||||
raise Http404
|
||||
response = HttpResponse(content_type='application/vnd.oasis.opendocument.spreadsheet')
|
||||
response['Content-Disposition'] = 'attachment; filename=%s.ods' % self.cube.name
|
||||
workbook = visualization.ods()
|
||||
|
|
Loading…
Reference in New Issue