Check filehash and filename, not just hash when checking if it needs to be saved. (#32)

This commit is contained in:
Tyrel Souza 2017-01-26 13:59:49 -05:00 committed by GitHub
parent 6df5f1c674
commit ff3c2f327a
4 changed files with 5 additions and 4 deletions

View File

@ -54,6 +54,7 @@ I will sign everything with 0x769A1BC78A2DDEE2
## CHANGELOG
- 2017-01-26 [Tyrel Souza] Check filehash and filename, not just hash when checking if it needs to be saved.
- 2017-01-25 [Tyrel Souza] Keeping Filename on upload.
- 2017-01-23 [Tyrel Souza] Add Modified Time to storage support
- 2017-01-23 [Tyrel Souza] Everything should return a "filename" even if it's generated. Make the filename be the hash + ext. (fall back to .txt)

View File

@ -63,7 +63,7 @@ class DBFileStorage(Storage):
file_ext = ".txt"
# create the file, or just return name if the exact file already exists
if not DBFile.objects.filter(pk=filehash).exists():
if not DBFile.objects.filter(filehash=filehash, name=name).exists():
the_file = DBFile(
name=name,
filehash=filehash,

View File

@ -54,9 +54,9 @@ author = u'Tyrel Souza'
# built documents.
#
# The short X.Y version.
version = u'0.5.1'
version = u'0.5.2'
# The full version, including alpha/beta/rc tags.
release = u'0.5.1'
release = u'0.5.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -24,7 +24,7 @@ class CleanCommand(Command):
setup(
name="django-dbfilestorage",
version="0.5.1",
version="0.5.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",