This commit is contained in:
Tyrel Souza 2017-08-17 11:15:44 -04:00 committed by GitHub
parent 60c3f77a58
commit fc974242ba
3 changed files with 6 additions and 2 deletions

View File

@ -47,6 +47,10 @@ class DBFileStorage(Storage):
""" """
if hasattr(content.file, "read"): if hasattr(content.file, "read"):
read_data = 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: else:
read_data = content.file.encode('utf8') read_data = content.file.encode('utf8')
b64 = read_data.encode('base64') b64 = read_data.encode('base64')

View File

@ -54,7 +54,7 @@ author = u'Tyrel Souza'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = u'0.9.1' version = u'0.9.2'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = version release = version

View File

@ -24,7 +24,7 @@ class CleanCommand(Command):
setup( setup(
name="django-dbfilestorage", name="django-dbfilestorage",
version="0.9.1", version="0.9.2",
description="Database backed file storage for testing.", description="Database backed file storage for testing.",
long_description="Database backed file storage for testing. Stores files as base64 encoded textfields.", long_description="Database backed file storage for testing. Stores files as base64 encoded textfields.",
author="Tyrel Souza", author="Tyrel Souza",