py3: send base64 document as str in storeResource (#46576)

This commit is contained in:
Thomas NOËL 2020-09-14 12:31:46 +02:00
parent 7dfc65e8b9
commit edae2d9faa
1 changed files with 4 additions and 3 deletions

View File

@ -21,8 +21,9 @@ import re
import requests
from django.views.generic import DetailView as GenericDetailView
from django.utils.decorators import method_decorator
from django.utils import six
from django.utils.decorators import method_decorator
from django.utils.encoding import force_text
from django.utils.six.moves.urllib import parse as urlparse
from django.views.decorators.csrf import csrf_exempt
@ -167,7 +168,7 @@ class ResourceView(DetailView):
if page and not empty_page: # add last page, if it contains values
document += page
document += '</body></html>'
encodedFile = base64.b64encode(document.encode('utf-8'))
encodedFile = force_text(base64.b64encode(document.encode('utf-8')))
fileFormat = 'html'
if debug:
@ -571,7 +572,7 @@ class DebugView(DetailView):
document += page
document += '</body></html>'
logger.debug('DOCUMENT HTML %r ', document)
encodedFile = base64.b64encode(document.encode('utf-8'))
encodedFile = force_text(base64.b64encode(document.encode('utf-8')))
fileFormat = 'html'
if debug: