From b77cb84695c26f7ba9fd7523b10832c9ce11dd0a Mon Sep 17 00:00:00 2001 From: Marcio Mazza Date: Fri, 29 Jul 2016 19:53:28 -0300 Subject: [PATCH] Corrige bug na leitura de layouts.yaml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O bug ocorre em ambientes onde está disponível o yaml.CSafeLoader que só trabalha com str ou stream --- sapl/crispy_layout_mixin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index c6c4437a6..34ae391e9 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -147,7 +147,9 @@ class CrispyLayoutFormMixin: def read_yaml_from_file(yaml_layout): # TODO cache this at application level t = template.loader.get_template(yaml_layout) - rendered = t.render() + # aqui é importante converter para str pois, dependendo do ambiente, + # o rtyaml pode usar yaml.CSafeLoader, que exige str ou stream + rendered = str(t.render()) return rtyaml.load(rendered)