Changeset - 517da705366c
[Not reviewed]
0 2 0
Christopher Neugebauer - 8 years ago 2016-10-14 18:19:10
chrisjrn@gmail.com
CSV fixes
2 files changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
registrasion/reporting/reports.py
Show inline comments
...
 
@@ -289,12 +289,12 @@ class ReportView(object):
 

	
 
        # Create the HttpResponse object with the appropriate CSV header.
 
        response = HttpResponse(content_type='text/csv')
 
        #response['Content-Disposition'] = 'attachment; filename="somefilename.csv"'
 

	
 
        writer = csv.writer(response)
 
        writer.writerow(list(report.headings()))
 
        encode = lambda i: i.encode("utf8") if isinstance(i, unicode) else i
 
        writer.writerow(list(encode(i) for i in report.headings()))
 
        for row in report.rows():
 
            writer.writerow(list(row))
 
            writer.writerow(list(encode(i) for i in row))
 

	
 
        return response
 

	
registrasion/reporting/views.py
Show inline comments
...
 
@@ -408,7 +408,7 @@ def attendee(request, form, user_id=None):
 
    ''' Returns a list of all manifested attendees if no attendee is specified,
 
    else displays the attendee manifest. '''
 

	
 
    if user_id is None and not form.has_changed():
 
    if user_id is None:
 
        return attendee_list(request)
 

	
 
    if form.cleaned_data["user"] is not None:
0 comments (0 inline, 0 general)