backoffice: hide legacy excel export behind a site option (#22026)

This commit is contained in:
Frédéric Péters 2018-02-22 13:54:54 +01:00
parent da19af24c8
commit d222855787
1 changed files with 2 additions and 2 deletions

View File

@ -986,7 +986,7 @@ class FormPage(Directory):
qs, _('Export a Spreadsheet'))
r += htmltext(' <li><a data-base-href="csv" href="csv%s">%s</a></li>') % (
qs, _('Export as CSV File'))
if xlwt:
if xlwt and get_publisher().has_site_option('legacy-excel-export'):
r += htmltext('<li><a data-base-href="xls" href="xls%s">%s</a></li>') % (
qs, _('Excel Export'))
if self.formdef.geolocations:
@ -1433,7 +1433,7 @@ class FormPage(Directory):
def xls(self):
self.check_access()
if xlwt is None:
if xlwt is None or not get_publisher().has_site_option('legacy-excel-export'):
raise errors.TraversalError()
fields = self.get_fields_from_query()