Skip to content

Commit

Permalink
fix: Change content-type of ICS export (#7468)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamareebjamal authored Nov 25, 2020
1 parent 707f160 commit 280ac5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/api/custom/calendars.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
def export_event(event_id):
event = Event.query.get_or_404(event_id)
include_sessions = 'include_sessions' in request.args
download = 'download' in request.args

response = to_ical(event, include_sessions=include_sessions)

if download:
response = make_response(response)
response = make_response(response)
response.headers['Content-Type'] = 'text/calendar'
if 'download' in request.args:
response.headers[
'Content-Disposition'
] = f'attachment; filename={event.identifier}-{event.name}-Calendar.ics;'
Expand Down

0 comments on commit 280ac5b

Please sign in to comment.