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
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
Ekaterina
wendelin
Commits
91f59b5d
Commit
91f59b5d
authored
May 29, 2019
by
Ivan Tyagov
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
15463dd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.IngestionPolicy.py
...teItem/portal_components/document.erp5.IngestionPolicy.py
+7
-7
No files found.
bt5/erp5_wendelin/DocumentTemplateItem/portal_components/document.erp5.IngestionPolicy.py
View file @
91f59b5d
...
@@ -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
...
@@ -116,4 +116,4 @@ class IngestionPolicy(Folder):
...
@@ -116,4 +116,4 @@ class IngestionPolicy(Folder):
if
ingestion_script
is
None
:
if
ingestion_script
is
None
:
raise
NotFound
(
'No such ingestion script found: %s'
%
ingestion_script_id
)
raise
NotFound
(
'No such ingestion script found: %s'
%
ingestion_script_id
)
ingestion_script
(
data_chunk
=
data_chunk
,
**
parameter_dict
)
ingestion_script
(
data_chunk
=
data_chunk
,
**
parameter_dict
)
\ No newline at end of file
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