Merge lp:~mhall119/loco-team-portal/fixes-613333 into lp:loco-team-portal

Proposed by Michael Hall
Status: Merged
Merged at revision: 222
Proposed branch: lp:~mhall119/loco-team-portal/fixes-613333
Merge into: lp:loco-team-portal
Diff against target: 12 lines (+1/-1)
1 file modified
loco_directory/events/views.py (+1/-1)
To merge this branch: bzr merge lp:~mhall119/loco-team-portal/fixes-613333
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Review via email: mp+31857@code.launchpad.net

Description of the change

Creates ascii-safe file attachment names for HTTP headers

To post a comment you must log in.
Revision history for this message
Daniel Holbach (dholbach) wrote :

Nice job!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'loco_directory/events/views.py'
2--- loco_directory/events/views.py 2010-07-31 16:19:29 +0000
3+++ loco_directory/events/views.py 2010-08-05 16:37:43 +0000
4@@ -48,7 +48,7 @@
5 """Return any list events as an ical"""
6 filename = "%s.ics" % name.replace(' ', '-').lower()
7 response = HttpResponse(mimetype='text/calendar')
8- response['Content-Disposition'] = 'attachment; filename=%s' % filename
9+ response['Content-Disposition'] = 'attachment; filename=%s' % filename.encode('ascii', 'replace')
10 response.write('''BEGIN:VCALENDAR
11 PRODID:-//loco.ubuntu.com//EN
12 VERSION:2.0

Subscribers

People subscribed via source and target branches