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
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
Boxiang Sun
erp5
Commits
eaf027b2
Commit
eaf027b2
authored
Jun 06, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BT: remove _EtagSupport__etag/size properties when exporting Files/Images
parent
d7acbf30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
product/ERP5/Document/BusinessTemplate.py
product/ERP5/Document/BusinessTemplate.py
+6
-0
product/ERP5/tests/testTemplateTool.py
product/ERP5/tests/testTemplateTool.py
+3
-2
No files found.
product/ERP5/Document/BusinessTemplate.py
View file @
eaf027b2
...
@@ -66,6 +66,7 @@ from Products.ERP5Type.dynamic.lazy_class import ERP5BaseBroken
...
@@ -66,6 +66,7 @@ from Products.ERP5Type.dynamic.lazy_class import ERP5BaseBroken
from
Products.ERP5Type.dynamic.portal_type_class
import
synchronizeDynamicModules
from
Products.ERP5Type.dynamic.portal_type_class
import
synchronizeDynamicModules
from
Products.ERP5Type.Core.PropertySheet
import
PropertySheet
as
PropertySheetDocument
from
Products.ERP5Type.Core.PropertySheet
import
PropertySheet
as
PropertySheetDocument
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5Type.TransactionalVariable
import
getTransactionalVariable
from
Products.ERP5.Document.File
import
File
from
OFS.Traversable
import
NotFound
from
OFS.Traversable
import
NotFound
from
OFS
import
SimpleItem
,
XMLExportImport
from
OFS
import
SimpleItem
,
XMLExportImport
from
OFS.Image
import
Pdata
from
OFS.Image
import
Pdata
...
@@ -617,6 +618,8 @@ class BaseTemplateItem(Implicit, Persistent):
...
@@ -617,6 +618,8 @@ class BaseTemplateItem(Implicit, Persistent):
for
attr
in
'errors'
,
'warnings'
,
'_proxy_roles'
:
for
attr
in
'errors'
,
'warnings'
,
'_proxy_roles'
:
if
not
obj
.
__dict__
.
get
(
attr
,
1
):
if
not
obj
.
__dict__
.
get
(
attr
,
1
):
delattr
(
obj
,
attr
)
delattr
(
obj
,
attr
)
elif
classname
in
(
'File'
,
'Image'
):
attr_set
.
update
((
'_EtagSupport__etag'
,
'size'
))
elif
classname
==
'SQL'
and
klass
.
__module__
==
'Products.ZSQLMethods.SQL'
:
elif
classname
==
'SQL'
and
klass
.
__module__
==
'Products.ZSQLMethods.SQL'
:
attr_set
.
update
((
'_arg'
,
'template'
))
attr_set
.
update
((
'_arg'
,
'template'
))
elif
interfaces
.
IIdGenerator
.
providedBy
(
obj
):
elif
interfaces
.
IIdGenerator
.
providedBy
(
obj
):
...
@@ -1462,6 +1465,9 @@ class ObjectTemplateItem(BaseTemplateItem):
...
@@ -1462,6 +1465,9 @@ class ObjectTemplateItem(BaseTemplateItem):
assert
container
.
meta_type
in
(
'ERP5 Cache Factory'
,
assert
container
.
meta_type
in
(
'ERP5 Cache Factory'
,
'ERP5 Cache Bag'
)
'ERP5 Cache Bag'
)
container
.
getParentValue
().
updateCache
()
container
.
getParentValue
().
updateCache
()
elif
obj
.
__class__
.
__name__
in
(
'File'
,
'Image'
):
if
"data"
in
obj
.
__dict__
:
File
.
_setData
.
__func__
(
obj
,
obj
.
data
)
elif
(
container
.
meta_type
==
'CMF Skins Tool'
)
and
\
elif
(
container
.
meta_type
==
'CMF Skins Tool'
)
and
\
(
old_obj
is
not
None
):
(
old_obj
is
not
None
):
# Keep compatibility with previous export format of
# Keep compatibility with previous export format of
...
...
product/ERP5/tests/testTemplateTool.py
View file @
eaf027b2
...
@@ -363,6 +363,7 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -363,6 +363,7 @@ class TestTemplateTool(ERP5TypeTestCase):
# We don't export revision anymore.
# We don't export revision anymore.
self
.
assertFalse
(
os
.
path
.
exists
(
os
.
path
.
join
(
root
,
'bt'
,
'revision'
)))
self
.
assertFalse
(
os
.
path
.
exists
(
os
.
path
.
join
(
root
,
'bt'
,
'revision'
)))
# Computed at download ...
# Computed at download ...
revision
=
'+Kds1k1J41hzO4yIO+GcKQukNps='
self
.
assertEqual
(
revision
,
template_tool
.
download
(
root
).
getRevision
())
self
.
assertEqual
(
revision
,
template_tool
.
download
(
root
).
getRevision
())
finally
:
finally
:
shutil
.
rmtree
(
root
)
shutil
.
rmtree
(
root
)
...
@@ -370,14 +371,14 @@ class TestTemplateTool(ERP5TypeTestCase):
...
@@ -370,14 +371,14 @@ class TestTemplateTool(ERP5TypeTestCase):
# ... at building by default ...
# ... at building by default ...
bt
.
build
()
bt
.
build
()
revision
=
bt
.
getRevision
()
revision
=
bt
.
getRevision
()
self
.
assertEqual
(
'
9rVhiz7Agr5G7L1jegm9yLuUD9U
='
,
revision
)
self
.
assertEqual
(
'
xR/n0PtLoc+1CR0AyJ+xGjbxsjE
='
,
revision
)
self
.
portal
.
portal_skins
.
erp5_test
.
manage_renameObject
(
'test_file'
,
self
.
portal
.
portal_skins
.
erp5_test
.
manage_renameObject
(
'test_file'
,
'test_file2'
)
'test_file2'
)
bt
.
build
(
update_revision
=
False
)
bt
.
build
(
update_revision
=
False
)
self
.
assertEqual
(
revision
,
bt
.
getRevision
())
self
.
assertEqual
(
revision
,
bt
.
getRevision
())
# ... and at export.
# ... and at export.
bt
.
export
(
str
(
random
.
random
()))
bt
.
export
(
str
(
random
.
random
()))
self
.
assertEqual
(
'
dhgvzCfmibJEiy5M+5axf9ZM3gA
='
,
bt
.
getRevision
())
self
.
assertEqual
(
'
fnLZVdsjkNDoC0JWstMY2XL1x+s
='
,
bt
.
getRevision
())
self
.
abort
()
self
.
abort
()
def
test_getInstalledBusinessTemplateList
(
self
):
def
test_getInstalledBusinessTemplateList
(
self
):
...
...
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