import csv

from django.http.response import HttpResponse


class CSVReportResponse(HttpResponse):

    def __init__(self, report, file_name='report.csv', *args, **kwargs):
        kwargs['content_type'] = 'text/csv'
        super(CSVReportResponse, self).__init__(*args, **kwargs)
        self['Content-Disposition'] = 'attachment; filename="{}}"'.format(file_name)

         writer = csv.writer(self)
         writer.writerow(report.headers)
         for row in report.data:
             writer.writerow(row)

@@ -338,17 +338,16 @@
 name=%22%7B%7D
-%7D
 %22'.forma
@@ -360,17 +360,16 @@
 _name)%0A%0A
- 
         
@@ -394,17 +394,16 @@
 r(self)%0A
- 
         
@@ -442,17 +442,16 @@
         
- 
 for row 
@@ -466,17 +466,16 @@
 t.data:%0A
- 
         

Fix wonky indentation