Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nikola Balog
erp5
Commits
d62e1018
Commit
d62e1018
authored
Jan 31, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: DownloadableMixin py3 ( and fix with length that might be incorrect)
parent
b982bb45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin.py
...ateItem/portal_components/mixin.erp5.DownloadableMixin.py
+3
-2
No files found.
product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.DownloadableMixin.py
View file @
d62e1018
...
@@ -146,12 +146,13 @@ class DownloadableMixin:
...
@@ -146,12 +146,13 @@ class DownloadableMixin:
if
output_format
is
None
:
if
output_format
is
None
:
output_format
=
format
output_format
=
format
RESPONSE
.
setHeader
(
'Content-Length'
,
len
(
data
))
if
output_format
in
VALID_TEXT_FORMAT_LIST
:
if
output_format
in
VALID_TEXT_FORMAT_LIST
:
RESPONSE
.
setHeader
(
'Content-Type'
,
'%s; charset=utf-8'
%
mime
)
RESPONSE
.
setHeader
(
'Content-Type'
,
'%s; charset=utf-8'
%
mime
)
if
not
isinstance
(
data
,
bytes
):
data
=
data
.
encode
(
'utf-8'
)
data
=
data
.
encode
(
'utf-8'
)
else
:
else
:
RESPONSE
.
setHeader
(
'Content-Type'
,
mime
)
RESPONSE
.
setHeader
(
'Content-Type'
,
mime
)
RESPONSE
.
setHeader
(
'Content-Length'
,
len
(
data
))
if
inline
is
_MARKER
:
if
inline
is
_MARKER
:
# by default, use inline for text and image formats
# by default, use inline for text and image formats
inline
=
output_format
in
(
VALID_TEXT_FORMAT_LIST
+
VALID_IMAGE_FORMAT_LIST
)
inline
=
output_format
in
(
VALID_TEXT_FORMAT_LIST
+
VALID_IMAGE_FORMAT_LIST
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment