Don't use the old STORAGE_BACKEND name but the storage_backend class

This commit is contained in:
Roberto Rosario
2014-07-03 23:29:34 -04:00
parent 891c62b5a3
commit 6e050d8390
2 changed files with 6 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ from django.db.models import Avg, Count, Min, Max
from common.utils import pretty_size, pretty_size_10
from .conf.settings import STORAGE_BACKEND
from .runtime import storage_backend
from .models import Document, DocumentType, DocumentPage, DocumentVersion
@@ -13,7 +13,7 @@ def get_used_size(path, file_list):
total_size = 0
for filename in file_list:
try:
total_size += STORAGE_BACKEND().size(STORAGE_BACKEND.separator.join([path, filename]))
total_size += storage_backend.size(storage_backend.separator.join([path, filename]))
except OSError:
pass
@@ -22,7 +22,7 @@ def get_used_size(path, file_list):
def storage_count(path=u'.'):
try:
directories, files = STORAGE_BACKEND().listdir(path)
directories, files = storage_backend.listdir(path)
except OSError:
return 0, 0
else: