The server I'm posting ym data to doesn't seem to support format call so I get the folowing error.
Use f-string instead of 'format' call for the functions below.
def write_xlsx_response(self, queryset):
response = HttpResponse(
content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
)
response["Content-Disposition"] = 'attachment; filename="{}.xlsx"'.format(
self.get_filename()
)
export_xlsx_assessment(queryset, response)
return response
def write_csv_response(self, queryset):
response = HttpResponse(content_type="application/CSV")
response["Content-Disposition"] = 'attachment; filename="{}.csv"'.format(
self.get_filename()
)
export_csv_assessment(queryset, response)
return response
Please how can I convert this to f-string.
Thanks
.formatisn't even supported. (That means Python 2.x, since even Python 3.0 has.format)