The document parsing was being turned off in the OCR tests
by setting the binary to an invalid value. A proper way
to disable automatic parsing was added in a previous commit
and this commit updates the test case class to use that method.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Update some view tests in the tags, sources and linking apps
to use the test case classes provided by the common app.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Instead of capturing the form save exceptions in the subclass
let the base class do the work.
Use the base class get_instance_extra_data method to avoid
some code repetition.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Update the generic single object create and edit views to display
critical exceptions instead of just raising them and stoping
execution. The should allow removing duplicated exception to message
code in subclasses of these views.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
These features were for Celery 4.2.1, since this version
has a regression, version 4.1.1 is used instead.
The version 4.2.1 features are removed also and implemented
in code.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Upgrade Celery version used from 3.1.26 to 4.1.1. The following
settings have been renamed: CELERY_ALWAYS_EAGER to
CELERY_TASK_ALWAYS_EAGER, BROKER_URL to CELERY_BROKER_URL.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Pillow was being initialized on import. This commit
moves the initialization to the __init__ method of the
Python backend subclass.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Squash together the following migrations:
- Common: 0010 to 0011
- Documents: 0029 to 0037
- Documents: 0042 to 0043
- Tags: 0001 to 0008
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Extract the new smart file caching code from the common app
and convert it into its own new app called file_caching.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Split the .model module from the document app into separate
modules by purpose. The new modules containing the documents
app models are: document_models.py, document_page_models.py,
document_type_models.py, and document_version_models.py.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Prepend "operation_" to the data migration functions
for clear purpose. Add keyword arguments to the RunPython
migration opration.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Several tests cause errors on purpose to test behaviors.
This commit mute these tests setting their debug level
to critical or by using a context manager to null their
stdout descriptor.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Change the use of the list/zip combinarion to generate
the full list of metadata lookup choices to a generator.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Incorporate the external django-autoadmin app as a core app
and convert it into a Mayan app. This change adds the new
settings: "COMMON_AUTOADMIN_EMAIL", "AUTOADMIN_PASSWORD", and
"AUTOADMIN_USERNAME".
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Add a new view to display the events of the current user.
The link to this view is added to the user menu in the main menu
bar.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
The HOME_VIEW setting is not a Django setting but a setting from the
common app. Move the HOME_VIEW to the COMMON namespace and rename it
to COMMON_HOME_VIEW.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Use Python's platform library to detect the operating system and
use different default paths for the binary dependencies.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Update which Document model manager the new version upload task
uses to fetch the document. Changing to the passthrough manager
allows the task to access document stubs which is the expected
behavior as new document with no versions are considered stubs.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Update the django_gpg app to work with the latest version of the
python-gnupg package (0.4.3).
The python-gnupg now returns a more clear error message to
differentiate between a bad passphrase and a missing passphrase.
This improments allows the django_gpg to simplify its error
message parsing and remove the literals:
"ERROR_MSG_NEED_PASSPHRASE" and "ERROR_MSG_GOOD_PASSPHRASE".
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Rename the setting "SIGNATURES_STORAGE_BACKEND" to
"DOCUMENT_SIGNATURES_STORAGE_BACKEND" and the setting
"SIGNATURES_STORAGE_BACKEND_ARGUMENTS" to
"DOCUMENT_SIGNATURES_STORAGE_BACKEND_ARGUMENTS". This is
to differentiate these from the settings of the django_gpg
app.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
Remove the SIGNATURES_GPG_HOME settings. The GPG keys are no longer
stored in disk but in the database itself making this setting obsolete.
This changed happened several versions ago and this removal doesn't affect
any code path.
Add two new settings to the app: SIGNATURES_GPG_BACKEND and
SIGNATURES_GPG_BACKEND_ARGUMENTS. These settings allow changing the
GPG backend that the app will use.
Remove the settings SIGNATURES_GPG_PATH. The path to the GPG binary
is now passed via the SIGNATURES_GPG_BACKEND_ARGUMENTS.
Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
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>
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>
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>