mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-05-02 18:44:42 +00:00
[Fixes #6] Fix for Python 3.x with string argument expected, got 'bytes'
This commit is contained in:
parent
a617143b2f
commit
d3217cc317
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ import uuid
|
|||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.utils.six import StringIO
|
||||
from django.utils.six import BytesIO
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.core.files.uploadedfile import InMemoryUploadedFile
|
||||
from django.template import defaultfilters as filters
|
||||
|
|
@ -24,7 +24,7 @@ class ImageForm(forms.Form):
|
|||
|
||||
def save(self, commit=True):
|
||||
img = scale_and_crop(self.files['image'], **MARKDOWNX_IMAGE_MAX_SIZE)
|
||||
thumb_io = StringIO()
|
||||
thumb_io = BytesIO()
|
||||
img.save(thumb_io, self.files['image'].content_type.split('/')[-1].upper())
|
||||
|
||||
file_name = str(self.files['image'])
|
||||
|
|
|
|||
Loading…
Reference in a new issue