diff --git a/mayan/apps/sources/classes.py b/mayan/apps/sources/classes.py index d54c9d2608..ab04b2d675 100644 --- a/mayan/apps/sources/classes.py +++ b/mayan/apps/sources/classes.py @@ -1,22 +1,12 @@ from __future__ import absolute_import import base64 -import errno import os import urllib -from django.core.exceptions import ObjectDoesNotExist from django.core.files import File -from django.core.files.storage import FileSystemStorage -from django.utils.encoding import smart_str -from django.utils.translation import ugettext -from django.utils.translation import ugettext_lazy as _ -from common.utils import fs_cleanup -from converter.api import convert, cache_cleanup -from converter.literals import (DEFAULT_ZOOM_LEVEL, DEFAULT_ROTATION, - DEFAULT_PAGE_NUMBER, DEFAULT_FILE_FORMAT_MIMETYPE) -from documents.conf.settings import DISPLAY_SIZE, THUMBNAIL_SIZE +from converter.api import convert from mimetype.api import get_mimetype @@ -54,7 +44,7 @@ class StagingFile(object): image.close() return u'data:%s;base64,%s' % (mimetype, base64_data) else: - return file_path + return converted_file_path def delete(self): os.unlink(self.get_full_path()) diff --git a/mayan/apps/sources/models.py b/mayan/apps/sources/models.py index 19cfb418b7..70b71628e6 100644 --- a/mayan/apps/sources/models.py +++ b/mayan/apps/sources/models.py @@ -7,7 +7,6 @@ import os from django.contrib.contenttypes import generic from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError -from django.core.files.storage import FileSystemStorage from django.db import models, transaction from django.utils.translation import ugettext_lazy as _ diff --git a/mayan/apps/sources/resources.py b/mayan/apps/sources/resources.py index 020545f467..abeeee98a0 100644 --- a/mayan/apps/sources/resources.py +++ b/mayan/apps/sources/resources.py @@ -5,7 +5,6 @@ import logging from rest_framework import serializers from rest_framework.reverse import reverse -from .classes import StagingFile from .models import StagingFolder logger = logging.getLogger(__name__) diff --git a/mayan/apps/sources/urls.py b/mayan/apps/sources/urls.py index a15c01091c..79caaae072 100644 --- a/mayan/apps/sources/urls.py +++ b/mayan/apps/sources/urls.py @@ -2,7 +2,8 @@ from __future__ import absolute_import from django.conf.urls import patterns, url -from .api import APIStagingSourceListView,APIStagingSourceView, APIStagingSourceFileView, APIStagingSourceFileImageView +from .api import (APIStagingSourceListView, APIStagingSourceView, + APIStagingSourceFileView, APIStagingSourceFileImageView) from .literals import (SOURCE_CHOICE_WEB_FORM, SOURCE_CHOICE_STAGING, SOURCE_CHOICE_WATCH) from .wizards import DocumentCreateWizard diff --git a/mayan/apps/sources/views.py b/mayan/apps/sources/views.py index 00d1032b1e..7cd9bbfadd 100644 --- a/mayan/apps/sources/views.py +++ b/mayan/apps/sources/views.py @@ -3,7 +3,6 @@ from __future__ import absolute_import from django.conf import settings from django.contrib import messages from django.core.exceptions import PermissionDenied -from django.core.files.storage import FileSystemStorage from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from django.shortcuts import render_to_response, get_object_or_404 @@ -13,11 +12,8 @@ from django.utils.safestring import mark_safe from django.utils.translation import ugettext from django.utils.translation import ugettext_lazy as _ -import sendfile - from acls.models import AccessEntry from common.utils import encapsulate -from documents.conf.settings import THUMBNAIL_SIZE from documents.exceptions import NewDocumentVersionNotAllowed from documents.models import DocumentType, Document from documents.permissions import (PERMISSION_DOCUMENT_CREATE, @@ -35,7 +31,6 @@ from .models import (WebForm, StagingFolder, SourceTransformation, from .permissions import (PERMISSION_SOURCES_SETUP_VIEW, PERMISSION_SOURCES_SETUP_EDIT, PERMISSION_SOURCES_SETUP_DELETE, PERMISSION_SOURCES_SETUP_CREATE) -from .staging import create_staging_file_class def document_create_siblings(request, document_id): diff --git a/mayan/apps/sources/widgets.py b/mayan/apps/sources/widgets.py index 9353500c97..e0cbb66fff 100644 --- a/mayan/apps/sources/widgets.py +++ b/mayan/apps/sources/widgets.py @@ -8,8 +8,7 @@ from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from converter.literals import DEFAULT_PAGE_NUMBER, DEFAULT_ROTATION, DEFAULT_ZOOM_LEVEL -from documents.conf.settings import (THUMBNAIL_SIZE, PREVIEW_SIZE, - DISPLAY_SIZE, MULTIPAGE_PREVIEW_SIZE) +from documents.conf.settings import THUMBNAIL_SIZE, PREVIEW_SIZE class FamFamRadioFieldRenderer(forms.widgets.RadioFieldRenderer):