Commit ad0be1ff authored by Aurel's avatar Aurel

raise exception if business template is not 'built' for exporting

remove unused exported property of business template


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4142 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 51b186e2
......@@ -224,6 +224,8 @@ class BusinessTemplateTarball(BusinessTemplateArchive):
tar.close()
io.close()
class TemplateConditionError(Exception): pass
class TemplateConflictError(Exception): pass
class BaseTemplateItem(Implicit, Persistent):
......@@ -2369,6 +2371,10 @@ Business Template is a set of definitions, such as skins, portal types and categ
"""
Export this Business Template
"""
if self.getBuildingState() != 'built':
raise TemplateConditionError, 'Business Template must be build before export'
if local:
# we export into a folder tree
bta = BusinessTemplateFolder(creation=1, path=path)
......@@ -2381,8 +2387,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
for prop in self.propertyMap():
type = prop['type']
id = prop['id']
# if id in ('uid', 'rid', 'sid', 'id_group', 'last_id'):
if id in ('uid'): # maybe remove rid, sid
if id in ('uid', 'rid', 'sid', 'id_group', 'last_id'):
continue
value = self.getProperty(id)
if type == 'text' or type == 'string' or type == 'int':
......
......@@ -190,7 +190,7 @@ class TemplateTool (BaseTool):
for prop in bt.propertyMap():
type = prop['type']
pid = prop['id']
if pid in ('uid', 'id'):
if pid in ('uid', 'id', 'rid', 'sid', 'id_group', 'last_id'):
continue
prop_path = os.path.join(tar.members[0].name, 'bt', pid)
info = tar.getmember(prop_path)
......@@ -234,7 +234,7 @@ class TemplateTool (BaseTool):
for prop in bt.propertyMap():
type = prop['type']
pid = prop['id']
if pid in ('uid', 'id'):
if pid in ('uid', 'id', 'rid', 'sid', 'id_group', 'last_id'):
continue
prop_path = os.path.join(bt_path, pid)
value = open(prop_path, 'r').read()
......
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