Adding right headers for ics view.

This commit is contained in:
Víðir Valberg Guðmundsson 2017-04-13 14:14:44 +02:00
parent ac39068e9b
commit 431c15e380

View file

@ -50,7 +50,10 @@ class ICSView(CampViewMixin, View):
for event_instance in eventinstances:
cal.add_component(event_instance.get_ics_event())
return HttpResponse(cal.to_ical())
response = HttpResponse(cal.to_ical())
response['Content-Type'] = 'text/calendar'
response['Content-Disposition'] = 'inline; filename={}.ics'.format(self.camp.slug)
return response
############## proposals ########################################################