Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
iv
erp5
Commits
16dbf2c3
Commit
16dbf2c3
authored
12 years ago
by
Ivan Tyagov
Browse files
Options
Download
Email Patches
Plain Diff
If original format is matched or format is empty string return original content of PDF document.
Adjust test accordingly and fix bad test.
parent
a4072868
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
product/ERP5/Document/PDFDocument.py
product/ERP5/Document/PDFDocument.py
+2
-1
product/ERP5OOo/tests/testDms.py
product/ERP5OOo/tests/testDms.py
+5
-1
No files found.
product/ERP5/Document/PDFDocument.py
View file @
16dbf2c3
...
...
@@ -95,7 +95,8 @@ class PDFDocument(Image):
data
=
self
.
_convertToDJVU
()
self
.
setConversion
(
data
,
mime
=
mime
,
format
=
'djvu'
)
return
(
mime
,
data
)
elif
format
is
None
:
elif
format
in
(
''
,
None
,)
or
format
==
'pdf'
:
# return original content
return
self
.
getContentType
(),
self
.
getData
()
else
:
if
kw
.
get
(
'frame'
,
None
)
is
None
:
...
...
This diff is collapsed.
Click to expand it.
product/ERP5OOo/tests/testDms.py
View file @
16dbf2c3
...
...
@@ -2201,9 +2201,13 @@ return 1
self
.
assertTrue
(
'Content-Length: %s
\r\n
'
%
getFileSize
(
'TEST-en-003.odp'
)
in
response
.
info
().
headers
)
response
=
getURL
(
pdf_document
.
absolute_url
(),
**
{
'format'
:
''
})
self
.
assertTrue
(
'Content-Type: application/
octet-stream
\r\n
'
in
response
.
info
().
headers
)
self
.
assertTrue
(
'Content-Type: application/
pdf
\r\n
'
in
response
.
info
().
headers
)
self
.
assertTrue
(
'Content-Disposition: attachment; filename="TEST-en-002.pdf"
\r\n
'
in
response
.
info
().
headers
)
response
=
getURL
(
pdf_document
.
absolute_url
(),
**
{
'format'
:
'pdf'
})
self
.
assertTrue
(
'Content-Type: application/pdf
\r\n
'
in
response
.
info
().
headers
)
self
.
assertTrue
(
'Content-Disposition: attachment; filename="TEST-en-002.pdf"
\r\n
'
in
response
.
info
().
headers
)
response
=
getURL
(
web_page_document
.
absolute_url
(),
**
{
'format'
:
''
})
self
.
assertTrue
(
'Content-Type: text/html; charset=utf-8
\r\n
'
in
response
.
info
().
headers
)
...
...
This diff is collapsed.
Click to expand it.
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