# HG changeset patch # User sylvain.thenault@logilab.fr # Date 1234908501 -3600 # Node ID 83228d379cbeb536c6fe48ac72f5a0ee2588f3d6 # Parent 39a2a66731715e6118cf98d0f217d21ff62a8c7e do it the other way diff -r 39a2a6673171 -r 83228d379cbe common/mttransforms.py --- a/common/mttransforms.py Tue Feb 17 23:00:28 2009 +0100 +++ b/common/mttransforms.py Tue Feb 17 23:08:21 2009 +0100 @@ -42,9 +42,12 @@ ENGINE.add_transform(html_to_html()) try: - from cubicweb.common.tal import compile_template + from cubicweb.ext.tal import compile_template except ImportError: HAS_TAL = False + from cubicweb.schema import FormatConstraint + FormatConstraint.need_perm_formats.remove('text/cubicweb-page-template') + else: HAS_TAL = True diff -r 39a2a6673171 -r 83228d379cbe schema.py --- a/schema.py Tue Feb 17 23:00:28 2009 +0100 +++ b/schema.py Tue Feb 17 23:08:21 2009 +0100 @@ -954,13 +954,8 @@ # translation PERM_USE_TEMPLATE_FORMAT = _('use_template_format') -from cubicweb.mttransforms import HAS_TAL - class FormatConstraint(StaticVocabularyConstraint): - if HAS_TAL: - need_perm_formats = (_('text/cubicweb-page-template'),) - else: - need_perm_formats = () + need_perm_formats = [_('text/cubicweb-page-template')] regular_formats = (_('text/rest'), _('text/html'),