X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/4d579bfcf20ca69d142c3bcc9eb96feb72888d63..618e0c55c1008f17e12ace86de85d1d02e2ba3c9:/stage2/views.py?ds=sidebyside diff --git a/stage2/views.py b/stage2/views.py index 6b04a57..ca9f935 100644 --- a/stage2/views.py +++ b/stage2/views.py @@ -55,7 +55,8 @@ def attachment_download(attachment): response = HttpResponse(content_type='application/force-download') response.write(attachment.file.read()) base, ext = attachment.filename().rsplit('.', 1) - response['Content-Disposition'] = 'attachment; filename="%s.%s"' % (base[:10].replace('\n', ''), ext) + response['Content-Disposition'] = 'attachment; filename="%s.%s"' % ( + base.strip()[:20].replace('\n', '').strip(), ext) response['Content-Length'] = response.tell() return response