change file name for calendar download
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user