Fixed DBFile not found on "url" method

This commit is contained in:
Adolfo Gómez García 2017-02-14 09:53:41 +01:00
parent b56bf7b13f
commit 57d1041f87

View File

@ -167,8 +167,11 @@ class FileStorage(Storage):
return False
def url(self, name):
uuid = self._dbFileForReadWrite(name).uuid
return urlparse.urljoin(self._base_url, uuid)
try:
uuid = self._dbFileForReadWrite(name).uuid
return urlparse.urljoin(self._base_url, uuid)
except DBFile.DoesNotExist:
return None
class CompressorFileStorage(FileStorage):
def __init__(self, *args, **kwargs):