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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
erp5
Commits
f05aab2a
Commit
f05aab2a
authored
Jul 05, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portal contributions does the same and much more, so we must use it.
parent
bb106904
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
22 deletions
+4
-22
bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py
bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py
+3
-21
bt5/erp5_web_shacache/bt/revision
bt5/erp5_web_shacache/bt/revision
+1
-1
No files found.
bt5/erp5_web_shacache/ExtensionTemplateItem/ShaCache.py
View file @
f05aab2a
...
@@ -65,7 +65,6 @@ def WebSection_setObject(self, id, ob, **kw):
...
@@ -65,7 +65,6 @@ def WebSection_setObject(self, id, ob, **kw):
"""
"""
Add any change of the file uploaded.
Add any change of the file uploaded.
"""
"""
sha512sum
=
hashlib
.
sha512
()
sha512sum
=
hashlib
.
sha512
()
self
.
REQUEST
.
_file
.
seek
(
0
)
self
.
REQUEST
.
_file
.
seek
(
0
)
while
True
:
while
True
:
...
@@ -93,26 +92,9 @@ def WebSection_putFactory(self, name, typ, body):
...
@@ -93,26 +92,9 @@ def WebSection_putFactory(self, name, typ, body):
The key is the file name.
The key is the file name.
"""
"""
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
group
=
(
'networkcache'
,)
document
=
portal
.
portal_contributions
.
newContent
(
data
=
body
,
new_id
=
str
(
portal
.
portal_ids
.
generateNewId
(
id_group
=
group
))
filename
=
name
,
registry
=
portal
.
portal_contribution_registry
discover_metadata
=
False
)
portal_type
=
registry
.
findPortalTypeName
(
filename
=
name
,
content_type
=
typ
)
if
portal_type
is
None
:
return
None
# The code bellow is inspired from ERP5Type.Core.Folder.newContent
pt
=
self
.
_getTypesTool
()
myType
=
pt
.
getTypeInfo
(
self
)
if
myType
is
not
None
and
not
myType
.
allowType
(
portal_type
)
and
\
'portal_contributions'
not
in
self
.
getPhysicalPath
():
raise
ValueError
(
'Disallowed subobject type: %s'
%
portal_type
)
container
=
portal
.
getDefaultModule
(
portal_type
)
pt
.
constructContent
(
type_name
=
portal_type
,
container
=
container
,
id
=
new_id
)
document
=
container
.
_getOb
(
new_id
)
# We can only change the state of the object after all the activities and
# We can only change the state of the object after all the activities and
# interaction workflow, to avoid any security problem.
# interaction workflow, to avoid any security problem.
...
...
bt5/erp5_web_shacache/bt/revision
View file @
f05aab2a
40
41
\ No newline at end of file
\ 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