From dee7dd542919dc21b53fc263d21137d68f492783 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 20 Aug 2018 02:50:48 -0400 Subject: [PATCH] Renamed setting LOCK_MANAGER_DEFAULT_BACKEND to LOCK_MANAGER_BACKEND. Add help text to settings. Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ mayan/apps/appearance/settings.py | 7 +++-- mayan/apps/document_signatures/settings.py | 11 +++++--- mayan/apps/documents/settings.py | 30 +++++++++++++++++----- mayan/apps/lock_manager/settings.py | 10 ++++++-- 5 files changed, 46 insertions(+), 14 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 723bffe6ac..d28566bda0 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -55,6 +55,8 @@ new YAML configuration file support. - Add new revertsettings management command. - Add new permission to edit setting via the UI. +- Renamed setting LOCK_MANAGER_DEFAULT_BACKEND to LOCK_MANAGER_BACKEND. +- Add help text to settings. 3.0.1 (2018-07-08) ================= diff --git a/mayan/apps/appearance/settings.py b/mayan/apps/appearance/settings.py index 94c73d2a57..ebcc2619ac 100644 --- a/mayan/apps/appearance/settings.py +++ b/mayan/apps/appearance/settings.py @@ -8,6 +8,9 @@ from .literals import DEFAULT_MAXIMUM_TITLE_LENGTH namespace = Namespace(name='appearance', label=_('Appearance')) setting_max_title_length = namespace.add_setting( - global_name='APPEARANCE_MAXIMUM_TITLE_LENGTH', - default=DEFAULT_MAXIMUM_TITLE_LENGTH + default=DEFAULT_MAXIMUM_TITLE_LENGTH, + global_name='APPEARANCE_MAXIMUM_TITLE_LENGTH', help_text=_( + 'Maximum number of characters that will be displayed as the view ' + 'title.' + ) ) diff --git a/mayan/apps/document_signatures/settings.py b/mayan/apps/document_signatures/settings.py index d3f04f8b67..7b537a3dcd 100644 --- a/mayan/apps/document_signatures/settings.py +++ b/mayan/apps/document_signatures/settings.py @@ -9,12 +9,17 @@ from smart_settings import Namespace namespace = Namespace(name='signatures', label=_('Document signatures')) setting_storage_backend = namespace.add_setting( - global_name='SIGNATURES_STORAGE_BACKEND', - default='django.core.files.storage.FileSystemStorage' + default='django.core.files.storage.FileSystemStorage', + global_name='SIGNATURES_STORAGE_BACKEND', help_text=_( + 'Path to the Storage subclass to use when storing detached ' + 'signatures.' + ) ) setting_storage_backend_arguments = namespace.add_setting( global_name='SIGNATURES_STORAGE_BACKEND_ARGUMENTS', default='{{location: {}}}'.format( os.path.join(settings.MEDIA_ROOT, 'document_signatures') - ), quoted=True + ), quoted=True, help_text=_( + 'Arguments to pass to the SIGNATURE_STORAGE_BACKEND. ' + ) ) diff --git a/mayan/apps/documents/settings.py b/mayan/apps/documents/settings.py index 3af7f5bd33..e47e3086cd 100644 --- a/mayan/apps/documents/settings.py +++ b/mayan/apps/documents/settings.py @@ -13,13 +13,18 @@ namespace = Namespace(name='documents', label=_('Documents')) setting_documentimagecache_storage = namespace.add_setting( global_name='DOCUMENTS_CACHE_STORAGE_BACKEND', - default='django.core.files.storage.FileSystemStorage', quoted=True + 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') - ), quoted=True + ), 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, @@ -60,7 +65,11 @@ setting_language_codes = namespace.add_setting( help_text=_('List of supported document languages. In ISO639-3 format.') ) settings_document_page_image_cache_time = namespace.add_setting( - global_name='DOCUMENTS_PAGE_IMAGE_CACHE_TIME', default='31556926' + global_name='DOCUMENTS_PAGE_IMAGE_CACHE_TIME', default='31556926', + help_text=_( + 'Time in seconds that the browser should cache the supplied document ' + 'images. The default of 31559626 seconds corresponde to 1 year.' + ) ) setting_preview_height = namespace.add_setting( global_name='DOCUMENTS_PREVIEW_HEIGHT', default='' @@ -89,19 +98,26 @@ setting_rotation_step = namespace.add_setting( ) setting_storage_backend = namespace.add_setting( global_name='DOCUMENTS_STORAGE_BACKEND', - default='django.core.files.storage.FileSystemStorage' + default='django.core.files.storage.FileSystemStorage', help_text=_( + 'Path to the Storage subclass to use when storing document ' + 'files.' + ) ) 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.') ) setting_thumbnail_height = namespace.add_setting( - global_name='DOCUMENTS_THUMBNAIL_HEIGHT', default='' + global_name='DOCUMENTS_THUMBNAIL_HEIGHT', default='', help_text=_( + 'Height in pixels of the document thumbnail image.' + ) ) setting_thumbnail_width = namespace.add_setting( - global_name='DOCUMENTS_THUMBNAIL_WIDTH', default='800' + global_name='DOCUMENTS_THUMBNAIL_WIDTH', default='800', help_text=( + 'Width in pixels of the document thumbnail image.' + ) ) setting_zoom_max_level = namespace.add_setting( global_name='DOCUMENTS_ZOOM_MAX_LEVEL', default=300, diff --git a/mayan/apps/lock_manager/settings.py b/mayan/apps/lock_manager/settings.py index 989362f411..b13f1e286a 100644 --- a/mayan/apps/lock_manager/settings.py +++ b/mayan/apps/lock_manager/settings.py @@ -11,10 +11,16 @@ namespace = Namespace(name='lock_manager', label=_('Lock manager')) setting_backend = namespace.add_setting( default=DEFAULT_BACKEND, - global_name='LOCK_MANAGER_DEFAULT_BACKEND', + global_name='LOCK_MANAGER_BACKEND', help_text=_( + 'Path to the class to use when to request and release ' + 'resource locks.' + ) ) setting_default_lock_timeout = namespace.add_setting( default=DEFAULT_LOCK_TIMEOUT_VALUE, - global_name='LOCK_MANAGER_DEFAULT_LOCK_TIMEOUT', + global_name='LOCK_MANAGER_DEFAULT_LOCK_TIMEOUT', help_text=_( + 'Default amount of time in seconds after which a resource ' + 'lock will be automatically released.' + ) )