Private
Public Access
1
0

change file name for calendar download

This commit is contained in:
Sander Roosendaal
2019-01-07 11:38:17 +01:00
parent 0264d47d11
commit 3491de6634
4 changed files with 207 additions and 217 deletions

View File

@@ -1947,7 +1947,12 @@ def plannedsessions_icsemail_view(request,userid=0):
response = HttpResponse(cal.to_ical())
response['Content-Disposition'] = 'attachment; filename="training_plan_%s.ics"' % request.user.id
response['Content-Disposition'] = 'attachment; filename="training_plan_{u}_{d1}_{d2}.ics"'.format(
u = request.user.username,
d1 = startdate.strftime("%Y%m%d"),
d2 = enddate.strftime("%Y%m%d"),
)
response['Content-Type'] = 'application/octet-stream'
return response