py3: use b64encode (#46576)
This commit is contained in:
parent
29da935811
commit
5a10ff7d98
|
@ -14,10 +14,11 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import requests
|
||||
import base64
|
||||
from datetime import datetime
|
||||
import logging
|
||||
import re
|
||||
import requests
|
||||
|
||||
from django.views.generic import DetailView as GenericDetailView
|
||||
from django.utils.decorators import method_decorator
|
||||
|
@ -165,7 +166,7 @@ class ResourceView(DetailView):
|
|||
if page and not empty_page: # add last page, if it contains values
|
||||
document += page
|
||||
document += '</body></html>'
|
||||
encodedFile = document.encode('utf-8').encode('base64')
|
||||
encodedFile = base64.b64encode(document.encode('utf-8'))
|
||||
fileFormat = 'html'
|
||||
|
||||
if debug:
|
||||
|
@ -569,7 +570,7 @@ class DebugView(DetailView):
|
|||
document += page
|
||||
document += '</body></html>'
|
||||
logger.debug('DOCUMENT HTML %r ', document)
|
||||
encodedFile = document.encode('utf-8').encode('base64')
|
||||
encodedFile = base64.b64encode(document.encode('utf-8'))
|
||||
fileFormat = 'html'
|
||||
|
||||
if debug:
|
||||
|
|
Loading…
Reference in New Issue