Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin
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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Klaus Wölfel
wendelin
Commits
01e6c52e
Commit
01e6c52e
authored
Jul 12, 2019
by
Klaus Wölfel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stop passing of REQUEST as a function parameter when it is a global
one (and already used in parts of code) as self.REQUEST.
parent
1c930c97
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.IngestionPolicy.py
...teItem/portal_components/document.erp5.IngestionPolicy.py
+6
-6
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.IngestionPolicy.py
View file @
01e6c52e
...
@@ -53,21 +53,21 @@ class IngestionPolicy(Folder):
...
@@ -53,21 +53,21 @@ class IngestionPolicy(Folder):
return
self
.
portal_ingestion_policies
.
unpack
(
data
)
return
self
.
portal_ingestion_policies
.
unpack
(
data
)
security
.
declarePublic
(
'ingest'
)
security
.
declarePublic
(
'ingest'
)
def
ingest
(
self
,
REQUEST
,
**
kw
):
def
ingest
(
self
,
**
kw
):
"""
"""
Ingest chunk of raw data either from a Sensor or any of DAUs.
Ingest chunk of raw data either from a Sensor or any of DAUs.
"""
"""
environ
=
REQUEST
.
environ
environ
=
self
.
REQUEST
.
environ
method
=
environ
.
pop
(
'REQUEST_METHOD'
)
method
=
environ
.
pop
(
'REQUEST_METHOD'
)
try
:
try
:
if
method
!=
'POST'
:
if
method
!=
'POST'
:
raise
BadRequest
(
'Only POST request is allowed.'
)
raise
BadRequest
(
'Only POST request is allowed.'
)
if
REQUEST
.
_file
is
not
None
:
if
self
.
REQUEST
.
_file
is
not
None
:
assert
not
REQUEST
.
form
,
REQUEST
.
form
# Are cgi and HTTPRequest fixed ?
assert
not
self
.
REQUEST
.
form
,
self
.
REQUEST
.
form
# Are cgi and HTTPRequest fixed ?
# Query string was ignored so parse again, faking a GET request.
# Query string was ignored so parse again, faking a GET request.
# Such POST is legit: https://stackoverflow.com/a/14710450
# Such POST is legit: https://stackoverflow.com/a/14710450
REQUEST
.
processInputs
()
self
.
REQUEST
.
processInputs
()
REQUEST
.
form
[
'data_chunk'
]
=
REQUEST
.
_file
.
read
()
self
.
REQUEST
.
form
[
'data_chunk'
]
=
self
.
REQUEST
.
_file
.
read
()
finally
:
finally
:
environ
[
'REQUEST_METHOD'
]
=
method
environ
[
'REQUEST_METHOD'
]
=
method
...
...
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