Don't use the old STORAGE_BACKEND name but the storage_backend class
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -33,7 +33,7 @@ from navigation.utils import resolve_to_name
|
||||
from permissions.models import Permission
|
||||
|
||||
from .events import HISTORY_DOCUMENT_EDITED
|
||||
from .conf.settings import (PREVIEW_SIZE, STORAGE_BACKEND, ZOOM_PERCENT_STEP,
|
||||
from .conf.settings import (PREVIEW_SIZE, ZOOM_PERCENT_STEP,
|
||||
ZOOM_MAX_LEVEL, ZOOM_MIN_LEVEL, ROTATION_STEP, RECENT_COUNT)
|
||||
from .forms import (DocumentForm_edit, DocumentPropertiesForm,
|
||||
DocumentPreviewForm, DocumentPageForm,
|
||||
@@ -51,6 +51,7 @@ from .permissions import (PERMISSION_DOCUMENT_PROPERTIES_EDIT,
|
||||
PERMISSION_DOCUMENT_VERSION_REVERT, PERMISSION_DOCUMENT_TYPE_EDIT,
|
||||
PERMISSION_DOCUMENT_TYPE_DELETE, PERMISSION_DOCUMENT_TYPE_CREATE,
|
||||
PERMISSION_DOCUMENT_TYPE_VIEW)
|
||||
from .runtime import storage_backend
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -532,7 +533,7 @@ def document_missing_list(request):
|
||||
else:
|
||||
missing_id_list = []
|
||||
for document in Document.objects.only('id',):
|
||||
if not STORAGE_BACKEND().exists(document.file):
|
||||
if not storate_backend.exists(document.file):
|
||||
missing_id_list.append(document.pk)
|
||||
|
||||
return render_to_response('generic_list.html', {
|
||||
|
||||
Reference in New Issue
Block a user