The get_page method had support to return the image in
base64 format. This feature is no longer used by any
other app.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Change the use of string_concat with format_lazy.
string_concat is deprecated in Django 1.11 and removed in
Django 2.1.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Update the type checking from using Django's six port
to use direct list and tuple instance checking.
Needed for Python 3.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Update the OCR app to use the document image cache instead
of trying to read the image file directly from
the document storage.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
The SearchModel class no longer returns an elapsed time
value. Update the tests and views that expect this removed
variable.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add filter(is_stub) to the default Document model manager.
Now only the Passthrough manager can access document stubs.
Remove the explicit filtering of stubs from code that obtains
the queryset from the default document manager.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Reduce the document thumbnail fadein animation length
to speed up display of resolved thumbnails.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
New log formatter that color the output depending on the log
level of the message. The default palette handles: INFO,
SUCCESS, ERROR, DEBUG and CRITICAL.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Instead of inserting the path of the apps into the Python app,
the apps are now referenced by their full import path.
This app name claves with external or native Python libraries.
Example: Mayan statistics app vs. Python new statistics library.
Every app reference is now prepended with 'mayan.apps'.
Existing config.yml files need to be updated manually.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Add a setting callback to update the size of the document
cache when the DOCUMENTS_CACHE_MAXIMUM_SIZE setting is
updated.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
Execute the prune method of a cache when its properties
are changed. This ensures the size of the cache matches
the maximum size set when last saved.
Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
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>