data sources: import xml as strings (#36515)

This commit is contained in:
Frédéric Péters 2019-11-14 10:38:00 +01:00
parent 75c18872dc
commit 4f7d4cd6cf
1 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ from django.utils.six.moves.urllib import parse as urlparse
from quixote import get_publisher, get_request, get_session
from quixote.html import TemplateIO
from .qommon import _
from .qommon import _, force_str
from .qommon.form import *
from .qommon.humantime import seconds2humanduration
from .qommon.misc import get_variadic_url
@ -323,8 +323,8 @@ class NamedDataSource(XmlStorableObject):
def import_data_source_from_xml(self, element, charset):
return {
'type': str(element.find('type').text),
'value': (element.find('value').text or '').encode(charset)
'type': force_str(element.find('type').text),
'value': force_str(element.find('value').text or ''),
}
@classmethod