Instead of passing strings as arguments to backends, all settings must
be formatted according to YAML specifications. This is to remove the
need to add separate YAML parsing to each backend argument in each
app that needs it. Argument passing to backends is not fully
uniform.
Users need to update their config files.
Example:
DOCUMENTS_STORAGE_BACKEND_ARGUMENTS: '{location: /home/rosarior/development/mayan-edms/mayan/media/document_storage}'
must be changed to:
DOCUMENTS_STORAGE_BACKEND_ARGUMENTS:
location: /home/rosarior/development/mayan-edms/mayan/media/document_storage
Example 2:
CONVERTER_GRAPHICS_BACKEND_CONFIG: ' { libreoffice_path: /usr/bin/libreoffice, pdftoppm_dpi:
300, pdftoppm_format: jpeg, pdftoppm_path: /usr/bin/pdftoppm, pdfinfo_path:
/usr/bin/pdfinfo, pillow_format: JPEG } '
must be changed to:
CONVERTER_GRAPHICS_BACKEND_CONFIG:
libreoffice_path: /usr/bin/libreoffice
pdftoppm_dpi: 300
pdftoppm_format: jpeg
pdftoppm_path: /usr/bin/pdftoppm
pdfinfo_path: /usr/bin/pdfinfo
pillow_format: JPEG
Example 3:
OCR_BACKEND_ARGUMENTS: ''
must be changed to:
OCR_BACKEND_ARGUMENTS: {}
Settings that need to be updated are:
- COMMON_SHARED_STORAGE_ARGUMENTS
- CONVERTER_GRAPHICS_BACKEND_CONFIG
- DOCUMENTS_CACHE_STORAGE_BACKEND_ARGUMENTS
- DOCUMENTS_STORAGE_BACKEND_ARGUMENTS
- OCR_BACKEND_ARGUMENTS
- SIGNATURES_STORAGE_BACKEND_ARGUMENTS
- SOURCES_STAGING_FILE_CACHE_STORAGE_BACKEND_ARGUMENTS
The following error will appear in the console if a setting is not yet
updated to this new format::
TypeError: type object argument after ** must be a mapping, not str
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
33 lines
1.2 KiB
Python
33 lines
1.2 KiB
Python
from __future__ import unicode_literals
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from smart_settings import Namespace
|
|
|
|
from .literals import (
|
|
DEFAULT_DOCUMENT_BODY_TEMPLATE, DEFAULT_LINK_BODY_TEMPLATE
|
|
)
|
|
|
|
namespace = Namespace(name='mailer', label=_('Mailing'))
|
|
|
|
setting_link_subject_template = namespace.add_setting(
|
|
default=_('Link for document: {{ document }}'),
|
|
help_text=_('Template for the document link email form subject line.'),
|
|
global_name='MAILER_LINK_SUBJECT_TEMPLATE'
|
|
)
|
|
setting_link_body_template = namespace.add_setting(
|
|
default=DEFAULT_LINK_BODY_TEMPLATE,
|
|
help_text=_('Template for the document link email form body text. Can include HTML.'),
|
|
global_name='MAILER_LINK_BODY_TEMPLATE'
|
|
)
|
|
setting_document_subject_template = namespace.add_setting(
|
|
default=_('Document: {{ document }}'),
|
|
help_text=_('Template for the document email form subject line.'),
|
|
global_name='MAILER_DOCUMENT_SUBJECT_TEMPLATE'
|
|
)
|
|
setting_document_body_template = namespace.add_setting(
|
|
default=DEFAULT_DOCUMENT_BODY_TEMPLATE,
|
|
help_text=_('Template for the document email form body text. Can include HTML.'),
|
|
global_name='MAILER_DOCUMENT_BODY_TEMPLATE'
|
|
)
|