data sources: import xml as strings (#36515)
This commit is contained in:
parent
75c18872dc
commit
4f7d4cd6cf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue