From 8e5bea85ae5becdc4c8550bc331ec89d4a11663f Mon Sep 17 00:00:00 2001 From: Olivier Leger Date: Wed, 30 Sep 2020 12:55:40 -0400 Subject: [PATCH] Force xml as unicode --- onadata/apps/viewer/models/data_dictionary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onadata/apps/viewer/models/data_dictionary.py b/onadata/apps/viewer/models/data_dictionary.py index ff07f53da..07a9aad2f 100644 --- a/onadata/apps/viewer/models/data_dictionary.py +++ b/onadata/apps/viewer/models/data_dictionary.py @@ -5,6 +5,7 @@ from django.db import models from django.db.models.signals import post_save +from django.utils.encoding import smart_text from guardian.shortcuts import assign_perm, get_perms_for_model from pyxform import SurveyElementBuilder from pyxform.builder import create_survey_from_xls @@ -12,7 +13,6 @@ from pyxform.section import RepeatingSection from pyxform.xform2json import create_survey_element_from_xml from xml.dom import Node - from onadata.apps.logger.models.xform import XForm from onadata.apps.logger.xform_instance_parser import clean_and_parse_xml from onadata.apps.api.mongo_helper import MongoHelper @@ -137,7 +137,7 @@ def set_uuid_in_xml(self, file_name=None, id_string=None): # and-silly-whitespace/ text_re = re.compile(r'>\n\s+([^<>\s].*?)\n\s+)\n( )*') - pretty_xml = text_re.sub(r'>\g<1>\g<1>', pretty_xml) inline_output = re.compile(r'').sub( '', inline_output)