Settings can be provided with a function via the new
"post_edit_function" argument. This function will be called
when the setting's value is updated. The function will only
receive one argument: The instance of the setting being
changed.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
With the creation of the new general use file Cache system
the old DocumentPageCachedImage model and manager are no longer
needed. This commit removed the model and the manager, and add
a migration to remove any data in the model before removing it
from the database.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add additional classes to split existing classes that are too complex.
Remove search timming.
Add query explainer.
Move literals to their own module.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add retry to race condition in intermediate image generation.
Remove DB index from cache file size field.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Working implementation with three levels of organization per cache.
Cache -> Partition -> File.
Current non blocking lock for the intermediate file generation needs
to be replaced to a blocking lock.
Needs tests.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
The settings/base.py file is expeting a dictionary of configuration
options. If there is no config.yml, return and empty dictionary
instead of a None result.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Make sure the no-result template looks the same when included from
all the parent templates.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add a delay to the image error handler attachment code to avoid
triggering a false image error event. This is cause when the error
handler is attached before the image is assigned a src attribute.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add the new list facet navigation menu. Used to provide facets
to the list subtemplate. The list facet allows separating the object
action links from the object navigation links. The list facet
links are displayed before the list object links on the list
subtemplate. In the object views, the list facet menu behaves
exactly the same as the form facet menu.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Refactor the workflow preview generation to work as a
background task API service. Solves GitLab issue #532.
The image generation runs as an out of process task
ensuring that the HTTP request is never compromised.
A new task queue named "document_states_fast" was created.
The settings WORKFLOWS_IMAGE_CACHE_TIME,
WORKFLOWS_IMAGE_CACHE_STORAGE_BACKEND,
WORKFLOWS_IMAGE_CACHE_STORAGE_BACKEND_ARGUMENTS we added.
Images generated are stored by default under /mayan/media/workflows.
The Dockerfile and deployment instructions are updated
to include the new queue.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Fix the way the form CSS contained in the media attribute
is rendered. This is now an interator and not a single value.
Replace the current method with a for loop.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add section to outline common pitfalls when installing.
Reference GitLab issue #487.
Update installation instructons to use the setting
MAYAN_DATABASES instead of the old MAYAN_DATABASE_*.
Unify the installation instructions by converting the
chapters into partials that are now included in the
topic file.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Increase the default value of the index mirroring cache timeout
from 10 seconds to 5 minutes. Since version 3.1.5, mirror
cache invalidation is tied to index updates. This makes the
timeout less relevant. The purpose of the cache timeout is
now avoid runaway memory usage.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add support for subfolder scanning to watch folders. Closes
GitLab issue #498.
This commit adds a new field to watch folders called
"include_subdirectories".
The directory walk was also updated to use pathlib2.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add support to the mailing profiles for specifying a "from"
address. Closes GitLab issue #522.
This commit adds a new backend class property "class_fields"
which differs from the normal "fields" property. The "class_fields"
property specifies which of the backend fields will be used to
initialize a backend's driver class. This is to avoid passing
fields that the driver doesn't expect and getting an error.
When sending emails, the "send" method will attempt to get
a "from" key from the backend data and use that when sending
emails. If no "from" key is found a None is passes. Django's
behavior in this situation dictates that the "from" value will
then be taken from the DEFAULT_FROM_EMAIL setting.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Delay the usage and initialization of Django settings
by removing their reference from the "save_configuration"
method declaration.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Fix formatting of the versioning section
and turn the list of version examples into a table.
Add further examples for minor and micro releases.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add two new custom password validators. One ensures
passwords have a minimum number of uppercase letters and the
other ensures passwords have a minimum amount of numbers.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Cleanup the Sphinx configuration file to comply with PEP8.
Enable the viewcode and autodoc extensions to start adding
code snippets in code.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Revert how the OCR and document parsing generators end
their iteration. Originally they issue an empty return,
then a blank yield was added. This commit reverts the
blank yield and restores the original 'return' behavior.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add the 'content' attribute to documents to allow access
to a document's parsed content for indexing and other purposes.
Fixes the document parsing indexing failing test.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add the 'ocr_content' attribute to documents to allow access
to a document's OCR content for indexing and other purposes.
Fixes the OCR indexing failing test.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Jinja2 doesn't support the {% empty %} node, instead it uses
the {% else %} node for the same purpose.
Fixed the tag indexing failing test.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Settings with lazy values are now more carefully checked
and converteed before serializing them.
Previously only the entire value was checked to see if it
was a promise. Now the value is checked to see if it is a
list or tuple and its members checked to see if they are
promises.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Expose new Django settings via the UI: AUTH_PASSWORD_VALIDATORS,
DEBUG, DEFAULT_FROM_EMAIL, INTERNAL_IPS, LANGUAGES,
LANGUAGE_CODE, STATIC_URL, STATICFILES_STORAGE,
TIME_ZONE, WSGI_APPLICATION.
Expose a new Celery setting via the UI: CELERY_ALWAYS_EAGER.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Refactor the initial environment settings and configuration file loading
fixing some issues loading Django settings.
Consolidate all database settings into a new single setting
called "DATABASES". This mirrors Django database setting
structure. This changes makes it possible to use configure
multiple databases and database routers from the environment
variables or configuration file.
Remove usage of django-environ. Only a small set of the
features provided by django-environ were being used.
Variable typecasting is now only YAML. YAML parsing
is implemented in code.
Previously the initial setting code added all settings
it found into the global symbol table. Now the settings
found are matched to a explicit list of allowed settings.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Update the default values of the settings which pass
arguments to backends to be valid Python values and not
YAML strings.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Change the CONVERTER_GRAPHICS_BACKEND_CONFIG settings
to CONVERTER_GRAPHICS_BACKEND_ARGUMENTS for uniformity
and to convey it real purpose which is initializing a backend.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Currently the link to navigate back to the settings
namespace is registered as an action when it is a link.
This commits changes it to a link in the facet menu.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
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>