0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Deleted Django 1.3 import fallback in utils/sendfile.py

This commit is contained in:
Mads Jensen 2017-10-04 23:55:14 +02:00 committed by Matt Westcott
parent f8bbd9b9b5
commit b655cda791

View File

@ -74,11 +74,7 @@ def sendfile(request, filename, attachment=False, attachment_filename=None, mime
parts = ['attachment']
if attachment_filename:
from unidecode import unidecode
try:
from django.utils.encoding import force_text
except ImportError:
# Django 1.3
from django.utils.encoding import force_unicode as force_text
from django.utils.encoding import force_text
attachment_filename = force_text(attachment_filename)
ascii_filename = unidecode(attachment_filename)
parts.append('filename="%s"' % ascii_filename)