Merge branch 'versions/minor' into features/workflow_email_action
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.22 on 2019-07-11 05:44
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import mayan.apps.documents.models.document_version_models
|
||||
import mayan.apps.storage.classes
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('documents', '0047_auto_20180917_0737'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='documentversion',
|
||||
name='file',
|
||||
field=models.FileField(storage=mayan.apps.storage.classes.FakeStorageSubclass(), upload_to=mayan.apps.documents.models.document_version_models.UUID_FUNCTION, verbose_name='File'),
|
||||
),
|
||||
]
|
||||
@@ -229,7 +229,7 @@ class DocumentPage(models.Model):
|
||||
for transformation in transformations:
|
||||
converter.transform(transformation=transformation)
|
||||
|
||||
return page_image
|
||||
return converter.get_page()
|
||||
except Exception as exception:
|
||||
# Cleanup in case of error
|
||||
logger.error(
|
||||
|
||||
@@ -5,7 +5,7 @@ import os
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.smart_settings import Namespace
|
||||
from mayan.apps.smart_settings.classes import Namespace
|
||||
|
||||
from .literals import (
|
||||
DEFAULT_DOCUMENTS_HASH_BLOCK_SIZE, DEFAULT_LANGUAGE, DEFAULT_LANGUAGE_CODES
|
||||
@@ -18,15 +18,14 @@ setting_documentimagecache_storage = namespace.add_setting(
|
||||
default='django.core.files.storage.FileSystemStorage', help_text=_(
|
||||
'Path to the Storage subclass to use when storing the cached '
|
||||
'document image files.'
|
||||
), quoted=True
|
||||
)
|
||||
)
|
||||
setting_documentimagecache_storage_arguments = namespace.add_setting(
|
||||
global_name='DOCUMENTS_CACHE_STORAGE_BACKEND_ARGUMENTS',
|
||||
default='{{location: {}}}'.format(
|
||||
os.path.join(settings.MEDIA_ROOT, 'document_cache')
|
||||
), help_text=_(
|
||||
default={'location': os.path.join(settings.MEDIA_ROOT, 'document_cache')},
|
||||
help_text=_(
|
||||
'Arguments to pass to the DOCUMENT_CACHE_STORAGE_BACKEND.'
|
||||
), quoted=True,
|
||||
),
|
||||
)
|
||||
setting_disable_base_image_cache = namespace.add_setting(
|
||||
global_name='DOCUMENTS_DISABLE_BASE_IMAGE_CACHE', default=False,
|
||||
@@ -127,9 +126,8 @@ setting_storage_backend = namespace.add_setting(
|
||||
)
|
||||
setting_storage_backend_arguments = namespace.add_setting(
|
||||
global_name='DOCUMENTS_STORAGE_BACKEND_ARGUMENTS',
|
||||
default='{{location: {}}}'.format(
|
||||
os.path.join(settings.MEDIA_ROOT, 'document_storage')
|
||||
), help_text=_('Arguments to pass to the DOCUMENT_STORAGE_BACKEND.')
|
||||
default={'location': os.path.join(settings.MEDIA_ROOT, 'document_storage')},
|
||||
help_text=_('Arguments to pass to the DOCUMENT_STORAGE_BACKEND.')
|
||||
)
|
||||
setting_thumbnail_height = namespace.add_setting(
|
||||
global_name='DOCUMENTS_THUMBNAIL_HEIGHT', default='', help_text=_(
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import yaml
|
||||
|
||||
try:
|
||||
from yaml import CSafeLoader as SafeLoader
|
||||
except ImportError:
|
||||
from yaml import SafeLoader
|
||||
|
||||
from django.utils.module_loading import import_string
|
||||
from mayan.apps.storage.utils import get_storage_subclass
|
||||
|
||||
from .settings import (
|
||||
setting_documentimagecache_storage,
|
||||
@@ -15,20 +8,10 @@ from .settings import (
|
||||
setting_storage_backend, setting_storage_backend_arguments
|
||||
)
|
||||
|
||||
storage_documentversion = import_string(
|
||||
storage_documentversion = get_storage_subclass(
|
||||
dotted_path=setting_storage_backend.value
|
||||
)(
|
||||
**yaml.load(
|
||||
stream=setting_storage_backend_arguments.value or '{}',
|
||||
Loader=SafeLoader
|
||||
)
|
||||
)
|
||||
)(**setting_storage_backend_arguments.value)
|
||||
|
||||
storage_documentimagecache = import_string(
|
||||
storage_documentimagecache = get_storage_subclass(
|
||||
dotted_path=setting_documentimagecache_storage.value
|
||||
)(
|
||||
**yaml.load(
|
||||
stream=setting_documentimagecache_storage_arguments.value or '{}',
|
||||
Loader=SafeLoader
|
||||
)
|
||||
)
|
||||
)(**setting_documentimagecache_storage_arguments.value)
|
||||
|
||||
Reference in New Issue
Block a user