mirror of
https://github.com/Hopiu/django-markdownx.git
synced 2026-04-10 16:40:57 +00:00
Merge pull request #7 from eduard-sukharev/fix_issue_6
Fix accessing file length in python3
This commit is contained in:
commit
b76b3a46ee
1 changed files with 2 additions and 1 deletions
|
|
@ -28,7 +28,8 @@ class ImageForm(forms.Form):
|
|||
img.save(thumb_io, self.files['image'].content_type.split('/')[-1].upper())
|
||||
|
||||
file_name = str(self.files['image'])
|
||||
img = InMemoryUploadedFile(thumb_io, "image", file_name, self.files['image'].content_type, thumb_io.len, None)
|
||||
thumb_io.seek(0, os.SEEK_END)
|
||||
img = InMemoryUploadedFile(thumb_io, "image", file_name, self.files['image'].content_type, thumb_io.tell(), None)
|
||||
|
||||
unique_file_name = self.get_unique_file_name(file_name)
|
||||
full_path = os.path.join(settings.MEDIA_ROOT, MARKDOWNX_MEDIA_PATH, unique_file_name)
|
||||
|
|
|
|||
Loading…
Reference in a new issue