Skip to content

Commit

Permalink
remove Unidecode dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
drakkan committed Oct 16, 2015
1 parent 0c764e2 commit a71395b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sendfile/__init__.py
Expand Up @@ -70,14 +70,14 @@ def sendfile(request, filename, attachment=False, attachment_filename=None, mime
attachment_filename = os.path.basename(filename)
parts = ['attachment']
if attachment_filename:
from unidecode import unidecode
import unicodedata
try:
from django.utils.encoding import force_text
except ImportError:
# Django 1.3
from django.utils.encoding import force_unicode as force_text
attachment_filename = force_text(attachment_filename)
ascii_filename = unidecode(attachment_filename)
ascii_filename = unicodedata.normalize('NFKD', attachment_filename).encode('ascii','ignore')
parts.append('filename="%s"' % ascii_filename)
if ascii_filename != attachment_filename:
from django.utils.http import urlquote
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Expand Up @@ -19,8 +19,8 @@
url='https://github.com/johnsensible/django-sendfile',
license='BSD',

requires=['Django (>=1.3)', 'Unidecode'],
install_requires=['Django>=1.3', 'Unidecode'],
requires=['Django (>=1.3)'],
install_requires=['Django>=1.3'],

packages=['sendfile', 'sendfile.backends'],
package_dir={
Expand Down

0 comments on commit a71395b

Please sign in to comment.