Commit 0a6324f2 authored by Łukasz Nowak's avatar Łukasz Nowak

Avoid publishing in activities.

During usage of shacache and shadir it was possible to publish document
immediately.

If there is problem with such scenario, it shall be fixed in correct place with
a test proving issue.
parent cabb7eae
......@@ -115,13 +115,7 @@ def WebSite_viewAsWebPost(self, *args, **kwargs):
document = portal.portal_contributions.newContent(data=self.REQUEST.BODY,
filename='shacache', discover_metadata=False, reference=sha512sum,
content_type='application/octet-stream')
# We can only change the state of the object after all the activities and
# interaction workflow, to avoid any security problem.
document.activate(after_path_and_method_id=(document.getPath(), \
('convertToBaseFormat', 'Document_tryToConvertToBaseFormat', \
'immediateReindexObject', 'recursiveImmediateReindexObject')))\
.publish()
document.publish()
self.REQUEST.RESPONSE.setStatus(201)
return sha512sum
......
59
\ No newline at end of file
60
\ No newline at end of file
......@@ -119,13 +119,6 @@ def WebSection_putFactory(self, name, typ, body):
document = portal.portal_contributions.newContent(data=body,
filename=name,
discover_metadata=False)
# We can only change the state of the object after all the activities and
# interaction workflow, to avoid any security problem.
document.activate(after_path_and_method_id=(document.getPath(), \
('convertToBaseFormat', 'Document_tryToConvertToBaseFormat', \
'immediateReindexObject', 'recursiveImmediateReindexObject')))\
.publish()
document.publish()
return document
59
\ No newline at end of file
60
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment