Replaced deprecated openpyxl get_active_sheet() call

This commit is contained in:
Claude Paroz 2017-08-30 18:09:18 +02:00
parent a4fe079475
commit d9c6289264

View file

@ -98,7 +98,7 @@ class KlassView(DetailView):
return super().render_to_response(context, **response_kwargs)
wb = Workbook()
ws = wb.get_active_sheet()
ws = wb.active
ws.title = self.object.name
bold = Style(font=Font(bold=True))
headers = [
@ -604,7 +604,7 @@ def stages_export(request, scope=None):
default_contacts[contact.corporation.name][sname] = contact
wb = Workbook()
ws = wb.get_active_sheet()
ws = wb.active
ws.title = 'Stages'
bold = Style(font=Font(bold=True))
# Headers
@ -651,7 +651,7 @@ IMPUTATIONS_EXPORT_FIELDS = [
def imputations_export(request):
wb = Workbook()
ws = wb.get_active_sheet()
ws = wb.active
ws.title = 'Imputations'
bold = Style(font=Font(bold=True))
for col_idx, header in enumerate(IMPUTATIONS_EXPORT_FIELDS, start=1):
@ -750,7 +750,7 @@ def general_export(request):
"""
export_fields = OrderedDict(GENERAL_EXPORT_FIELDS)
wb = Workbook()
ws = wb.get_active_sheet()
ws = wb.active
ws.title = 'Exportation'
bold = Style(font=Font(bold=True))
for col_idx, header in enumerate(export_fields.keys(), start=1):