Seek 0 (#39)
This commit is contained in:
parent
60c3f77a58
commit
fc974242ba
@ -47,6 +47,10 @@ class DBFileStorage(Storage):
|
||||
"""
|
||||
if hasattr(content.file, "read"):
|
||||
read_data = content.file.read()
|
||||
if not read_data:
|
||||
# If it's empty, try to seek once.
|
||||
content.file.seek(0)
|
||||
read_data = content.file.read()
|
||||
else:
|
||||
read_data = content.file.encode('utf8')
|
||||
b64 = read_data.encode('base64')
|
||||
|
@ -54,7 +54,7 @@ author = u'Tyrel Souza'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'0.9.1'
|
||||
version = u'0.9.2'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = version
|
||||
|
||||
|
2
setup.py
2
setup.py
@ -24,7 +24,7 @@ class CleanCommand(Command):
|
||||
|
||||
setup(
|
||||
name="django-dbfilestorage",
|
||||
version="0.9.1",
|
||||
version="0.9.2",
|
||||
description="Database backed file storage for testing.",
|
||||
long_description="Database backed file storage for testing. Stores files as base64 encoded textfields.",
|
||||
author="Tyrel Souza",
|
||||
|
Loading…
Reference in New Issue
Block a user