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
=== modified file 'loco_directory/events/views.py'
--- loco_directory/events/views.py 2010-07-31 16:19:29 +0000
+++ loco_directory/events/views.py 2010-08-05 16:37:43 +0000
@@ -48,7 +48,7 @@
48 """Return any list events as an ical"""48 """Return any list events as an ical"""
49 filename = "%s.ics" % name.replace(' ', '-').lower()49 filename = "%s.ics" % name.replace(' ', '-').lower()
50 response = HttpResponse(mimetype='text/calendar')50 response = HttpResponse(mimetype='text/calendar')
51 response['Content-Disposition'] = 'attachment; filename=%s' % filename51 response['Content-Disposition'] = 'attachment; filename=%s' % filename.encode('ascii', 'replace')
52 response.write('''BEGIN:VCALENDAR52 response.write('''BEGIN:VCALENDAR
53PRODID:-//loco.ubuntu.com//EN53PRODID:-//loco.ubuntu.com//EN
54VERSION:2.054VERSION:2.0

Subscribers

People subscribed via source and target branches