From bda44212b18fe7429b8466e9a7043c3ccbdcae16 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 10 Aug 2017 01:23:27 -0400 Subject: [PATCH] Disregard the last 3 dots that mark the end of the YAML document. Signed-off-by: Roberto Rosario --- HISTORY.rst | 1 + mayan/apps/smart_settings/classes.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5265912a6d..7ac4c5fff0 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,6 +19,7 @@ - Add support for rendering workflows. - Add support for unbinding sub menus. - Fix mailing profile test view. +- Disregard the last 3 dots that mark the end of the YAML document. 2.6.4 (2017-07-26) ================== diff --git a/mayan/apps/smart_settings/classes.py b/mayan/apps/smart_settings/classes.py index 28cc3e668b..0fdbbd86e2 100644 --- a/mayan/apps/smart_settings/classes.py +++ b/mayan/apps/smart_settings/classes.py @@ -81,7 +81,13 @@ class Setting(object): if isinstance(value, Promise): value = force_text(value) - return yaml.safe_dump(value, allow_unicode=True) + result = yaml.safe_dump(value, allow_unicode=True) + # safe_dump returns bytestrings + # Disregard the last 3 dots that mark the end of the YAML document + if result.endswith(b'...\n'): + result = result[:-4] + + return result @classmethod def get(cls, global_name):