From 3c63ea8048e117c12a92ac8a2f150a59c4522280 Mon Sep 17 00:00:00 2001 From: Samuel Gaist <samuel.gaist@idiap.ch> Date: Wed, 29 Aug 2018 15:17:24 +0200 Subject: [PATCH] [common][models] Improved declaration_string to ensure a string is returned --- beat/web/common/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/beat/web/common/models.py b/beat/web/common/models.py index 34c14ba3d..324a2f724 100755 --- a/beat/web/common/models.py +++ b/beat/web/common/models.py @@ -41,6 +41,7 @@ from . import storage from .exceptions import NotUserNorTeam from .signals import shared +from .utils import ensure_string import os import re @@ -640,7 +641,8 @@ def get_declaration(instance): def get_declaration_string(instance): - return storage.get_file_content(instance, 'declaration_file') + data = storage.get_file_content(instance, 'declaration_file') + return ensure_string(data) #---------------------------------------------------------- -- GitLab