1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #16703 -- Raise an exception if the storage location of the DefaultStorageFinder is empty.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16863 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Jannis Leidel
2011-09-21 15:58:32 +00:00
parent eb5df8e98d
commit c4cc875643
4 changed files with 34 additions and 6 deletions

View File

@@ -12,7 +12,8 @@ from django.utils.encoding import force_unicode, filepath_to_uri
from django.utils.functional import LazyObject
from django.utils.importlib import import_module
from django.utils.text import get_valid_filename
from django.utils._os import safe_join
from django.utils._os import safe_join, abspathu
__all__ = ('Storage', 'FileSystemStorage', 'DefaultStorage', 'default_storage')
@@ -145,9 +146,10 @@ class FileSystemStorage(Storage):
def __init__(self, location=None, base_url=None):
if location is None:
location = settings.MEDIA_ROOT
self.base_location = location
self.location = abspathu(self.base_location)
if base_url is None:
base_url = settings.MEDIA_URL
self.location = os.path.abspath(location)
self.base_url = base_url
def _open(self, name, mode='rb'):