fnp
/
edumed.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4d579bf
)
prettify abbreviated filename
author
Jan Szejko
<janek37@gmail.com>
Mon, 16 Jan 2017 09:15:39 +0000
(10:15 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Mon, 16 Jan 2017 09:15:39 +0000
(10:15 +0100)
stage2/views.py
patch
|
blob
|
history
diff --git
a/stage2/views.py
b/stage2/views.py
index
6b04a57
..
59c2d82
100644
(file)
--- a/
stage2/views.py
+++ b/
stage2/views.py
@@
-55,7
+55,7
@@
def attachment_download(attachment):
response = HttpResponse(content_type='application/force-download')
response.write(attachment.file.read())
base, ext = attachment.filename().rsplit('.', 1)
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[:
20].replace('\n', '').strip(
), ext)
response['Content-Length'] = response.tell()
return response
response['Content-Length'] = response.tell()
return response