don't fail on error in version templates json (#4346)

This commit is contained in:
Frédéric Péters 2014-02-24 15:36:45 +01:00
parent 884cf78324
commit c02496e59e
1 changed files with 4 additions and 1 deletions

View File

@ -55,7 +55,10 @@ def file_source(context):
except AttributeError:
version_templates = '/ foo'
if os.path.exists(version_templates):
templates = json.load(file(version_templates))
try:
templates = json.load(file(version_templates))
except:
templates = []
for entry in templates:
if entry.get('portal_types') and context.portal_type not in entry.get('portal_types'):
continue