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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
d23a57af
Commit
d23a57af
authored
Dec 21, 2012
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 'Upload Business Template' that did not work when the first entry was not the root directory.
parent
b6ad0793
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
product/ERP5/Tool/TemplateTool.py
product/ERP5/Tool/TemplateTool.py
+2
-1
No files found.
product/ERP5/Tool/TemplateTool.py
View file @
d23a57af
...
@@ -316,6 +316,7 @@ class TemplateTool (BaseTool):
...
@@ -316,6 +316,7 @@ class TemplateTool (BaseTool):
# XXX: should really check for a magic and offer a falback if it
# XXX: should really check for a magic and offer a falback if it
# doens't correspond to anything handled.
# doens't correspond to anything handled.
tar
=
tarfile
.
open
(
path
,
'r:gz'
)
tar
=
tarfile
.
open
(
path
,
'r:gz'
)
dir_name
=
tar
.
members
[
0
].
name
.
split
(
posixpath
.
sep
,
1
)[
0
]
try
:
try
:
# create bt object
# create bt object
bt
=
self
.
newContent
(
portal_type
=
'Business Template'
,
id
=
id
)
bt
=
self
.
newContent
(
portal_type
=
'Business Template'
,
id
=
id
)
...
@@ -323,7 +324,7 @@ class TemplateTool (BaseTool):
...
@@ -323,7 +324,7 @@ class TemplateTool (BaseTool):
for
prop
in
bt
.
propertyMap
():
for
prop
in
bt
.
propertyMap
():
prop_type
=
prop
[
'type'
]
prop_type
=
prop
[
'type'
]
pid
=
prop
[
'id'
]
pid
=
prop
[
'id'
]
prop_path
=
posixpath
.
join
(
tar
.
members
[
0
].
name
,
'bt'
,
pid
)
prop_path
=
posixpath
.
join
(
dir_
name
,
'bt'
,
pid
)
try
:
try
:
info
=
tar
.
getmember
(
prop_path
)
info
=
tar
.
getmember
(
prop_path
)
value
=
tar
.
extractfile
(
info
).
read
()
value
=
tar
.
extractfile
(
info
).
read
()
...
...
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