Merge branch 'features/explicit_app_paths' of gitlab.com:mayan-edms/mayan-edms into features/explicit_app_paths
This commit is contained in:
44
HISTORY.rst
44
HISTORY.rst
@@ -111,6 +111,50 @@
|
||||
The maximum size of the document cache is controlled
|
||||
by the new DOCUMENTS_CACHE_MAXIMUM_SIZE setting.
|
||||
This setting defaults to 500 megabytes.
|
||||
- Add support for post edit callbacks to settings. This
|
||||
callback willl execute when a settings's value is changed.
|
||||
- Switch to full app paths. Instead of inserting the path
|
||||
of the apps into the Python app, the apps are now
|
||||
referenced by their full import path. This avoid app name
|
||||
clashes 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.
|
||||
- Added a colorized console log formatter. New log formatter
|
||||
that colors the output depending on the log level of the
|
||||
message. The default palette handles: INFO, SUCCESS, ERROR,
|
||||
DEBUG and CRITICAL.
|
||||
- Decreased the thumbnail fade-in duration. Reduce the
|
||||
document thumbnail fadein animation length to speed up
|
||||
display of resolved thumbnails. Seems to reduce browser
|
||||
load in FireFox.
|
||||
- Document stubs are now filtered from the search results.
|
||||
- Replaced deprecated string_concat in preparation for an
|
||||
eventual Django 2.x upgrade.
|
||||
- Removed the converter's base64 image support as it was
|
||||
no longer being used by any stock app.
|
||||
- Removed 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.
|
||||
- Added two new settings to the django_gpg app:
|
||||
SIGNATURES_GPG_BACKEND and SIGNATURES_GPG_BACKEND_ARGUMENTS.
|
||||
These settings allow changing the GPG backend that the
|
||||
app will use.
|
||||
- Removed the settings SIGNATURES_GPG_PATH. The path to the
|
||||
GPG binary is now passed via the
|
||||
SIGNATURES_GPG_BACKEND_ARGUMENTS.
|
||||
- Renamed the setting ``SIGNATURES_STORAGE_BACKEND`` to
|
||||
``DOCUMENT_SIGNATURES_STORAGE_BACKEND`` and the setting
|
||||
``SIGNATURES_STORAGE_BACKEND_ARGUMENTS`` to
|
||||
``DOCUMENT_SIGNATURES_STORAGE_BACKEND_ARGUMENTS``. This
|
||||
change differentiates them from the setting from the
|
||||
django_gpg app.
|
||||
- Updated the django_gpg app to work with the latest
|
||||
version of the python-gnupg package (0.4.3).
|
||||
- Set sensible default path for binaries by detecting
|
||||
the operating system.
|
||||
|
||||
3.1.9 (2018-11-01)
|
||||
==================
|
||||
|
||||
@@ -9,10 +9,10 @@ Changes
|
||||
|
||||
* Improve index mirroring value clean up code to remove the spaces at the
|
||||
starts and at the end of directories. Closes again GitLab issue #520
|
||||
Thanks to TheOneValen @ for the report.
|
||||
Thanks to @TheOneValen for the report.
|
||||
* Improve index mirroring cache class to use the hash of the keys
|
||||
instead of the literal keys. Avoid warning about invalid key
|
||||
characters. Closes GitLab issue #518. Thanks to TheOneValen @ for the
|
||||
characters. Closes GitLab issue #518. Thanks to @TheOneValen for the
|
||||
report.
|
||||
* Only render the Template API view for authenticated users.
|
||||
Thanks rgarcia for the report.
|
||||
|
||||
@@ -12,10 +12,10 @@ Changes
|
||||
* Remove duplicate YAML loading of environment variables.
|
||||
* Don't load development apps if they are already loaded.
|
||||
* Make sure all key used as input for the cache key hash are
|
||||
bytes and not unicode. GitLab issue #520. Thanks to TheOneValen
|
||||
@TheOneValen for the report.
|
||||
bytes and not unicode. GitLab issue #520. Thanks to @TheOneValen for
|
||||
the report.
|
||||
* Ignore document stub from the index mirror. GitLab issue
|
||||
#520. Thanks to TheOneValen @TheOneValen for the report.
|
||||
#520. Thanks to @TheOneValen for the report.
|
||||
* Fix for the Docker image INSTALL_FLAG path. Thanks to
|
||||
Mark Maglana @relaxdiego for the report and to Hamish Farroq @farroq_HAM
|
||||
for the patch. GitLab issue #525.
|
||||
|
||||
@@ -8,7 +8,8 @@ Changes
|
||||
-------
|
||||
|
||||
* Convert the furl instance to text to allow serializing it into
|
||||
JSON to be passed as arguments to the background task.
|
||||
JSON and be passed as arguments to the background task. Fixes
|
||||
metadata assignment issues when uploading new documents.
|
||||
|
||||
Removals
|
||||
--------
|
||||
|
||||
@@ -2,7 +2,6 @@ from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.shortcuts import get_object_or_404
|
||||
|
||||
from rest_framework import generics
|
||||
|
||||
from .models import AccessControlList
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from __future__ import unicode_literals, absolute_import
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
import logging
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from mayan.apps.navigation import Link
|
||||
|
||||
from .icons import icon_acl_list, icon_acl_new
|
||||
from .permissions import permission_acl_view, permission_acl_edit
|
||||
from .permissions import permission_acl_edit, permission_acl_view
|
||||
|
||||
|
||||
def get_kwargs_factory(variable_name):
|
||||
|
||||
@@ -6,14 +6,15 @@ from django.contrib.contenttypes.models import ContentType
|
||||
from django.core.exceptions import PermissionDenied
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import ugettext, ugettext_lazy as _
|
||||
from django.utils.translation import ugettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.common.utils import return_attrib, return_related
|
||||
from mayan.apps.permissions import Permission
|
||||
from mayan.apps.permissions.models import StoredPermission
|
||||
|
||||
from .exceptions import PermissionNotValidForClass
|
||||
from .classes import ModelPermission
|
||||
from .exceptions import PermissionNotValidForClass
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -12,7 +12,9 @@ from rest_framework.reverse import reverse
|
||||
from mayan.apps.common.serializers import ContentTypeSerializer
|
||||
from mayan.apps.permissions import Permission
|
||||
from mayan.apps.permissions.models import Role, StoredPermission
|
||||
from mayan.apps.permissions.serializers import PermissionSerializer, RoleSerializer
|
||||
from mayan.apps.permissions.serializers import (
|
||||
PermissionSerializer, RoleSerializer
|
||||
)
|
||||
|
||||
from .models import AccessControlList
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from django.urls import reverse
|
||||
from mayan.apps.documents.tests import GenericDocumentViewTestCase
|
||||
|
||||
from ..links import (
|
||||
link_acl_delete, link_acl_list, link_acl_create, link_acl_permissions
|
||||
link_acl_create, link_acl_delete, link_acl_list, link_acl_permissions
|
||||
)
|
||||
from ..models import AccessControlList
|
||||
from ..permissions import permission_acl_edit, permission_acl_view
|
||||
|
||||
@@ -7,8 +7,8 @@ from mayan.apps.common.tests import BaseTestCase
|
||||
from mayan.apps.documents.models import Document, DocumentType
|
||||
from mayan.apps.documents.permissions import permission_document_view
|
||||
from mayan.apps.documents.tests import (
|
||||
TEST_SMALL_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL,
|
||||
TEST_DOCUMENT_TYPE_2_LABEL
|
||||
TEST_DOCUMENT_TYPE_2_LABEL, TEST_DOCUMENT_TYPE_LABEL,
|
||||
TEST_SMALL_DOCUMENT_PATH
|
||||
)
|
||||
|
||||
from ..models import AccessControlList
|
||||
|
||||
@@ -15,7 +15,7 @@ from mayan.apps.common.views import (
|
||||
AssignRemoveView, SingleObjectCreateView, SingleObjectDeleteView,
|
||||
SingleObjectListView
|
||||
)
|
||||
from mayan.apps.permissions import PermissionNamespace, Permission
|
||||
from mayan.apps.permissions import Permission, PermissionNamespace
|
||||
from mayan.apps.permissions.models import StoredPermission
|
||||
|
||||
from .classes import ModelPermission
|
||||
|
||||
@@ -8,8 +8,8 @@ from django.urls import reverse
|
||||
from mayan.apps.common.tests import GenericViewTestCase
|
||||
from mayan.apps.smart_settings.classes import Namespace
|
||||
from mayan.apps.user_management.tests.literals import (
|
||||
TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_USER_PASSWORD_EDITED,
|
||||
TEST_ADMIN_USERNAME
|
||||
TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME,
|
||||
TEST_USER_PASSWORD_EDITED
|
||||
)
|
||||
|
||||
from ..settings import setting_maximum_session_length
|
||||
|
||||
@@ -10,7 +10,6 @@ from .views import (
|
||||
password_reset_done_view, password_reset_view
|
||||
)
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^login/$', login_view, name='login_view'),
|
||||
url(
|
||||
|
||||
@@ -4,8 +4,8 @@ from django.conf import settings
|
||||
from django.contrib import messages
|
||||
from django.contrib.auth import REDIRECT_FIELD_NAME
|
||||
from django.contrib.auth.views import (
|
||||
login, password_change, password_reset, password_reset_confirm,
|
||||
password_reset_complete, password_reset_done
|
||||
login, password_change, password_reset, password_reset_complete,
|
||||
password_reset_confirm, password_reset_done
|
||||
)
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import redirect, resolve_url
|
||||
@@ -16,7 +16,9 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from stronghold.decorators import public
|
||||
|
||||
import mayan
|
||||
from mayan.apps.common.settings import setting_project_title, setting_project_url
|
||||
from mayan.apps.common.settings import (
|
||||
setting_project_title, setting_project_url
|
||||
)
|
||||
|
||||
from .forms import EmailAuthenticationForm, UsernameAuthenticationForm
|
||||
from .settings import setting_login_method, setting_maximum_session_length
|
||||
|
||||
@@ -2,10 +2,10 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import Cabinet
|
||||
|
||||
from mptt.admin import MPTTModelAdmin
|
||||
|
||||
from .models import Cabinet
|
||||
|
||||
|
||||
@admin.register(Cabinet)
|
||||
class CabinetAdmin(MPTTModelAdmin):
|
||||
|
||||
@@ -4,7 +4,9 @@ from django.apps import apps
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.acls import ModelPermission
|
||||
from mayan.apps.acls.permissions import permission_acl_edit, permission_acl_view
|
||||
from mayan.apps.acls.permissions import (
|
||||
permission_acl_edit, permission_acl_view
|
||||
)
|
||||
from mayan.apps.common import (
|
||||
MayanAppConfig, menu_facet, menu_main, menu_multi_item, menu_object,
|
||||
menu_sidebar
|
||||
@@ -13,12 +15,11 @@ from mayan.apps.documents.search import document_page_search, document_search
|
||||
from mayan.apps.navigation import SourceColumn
|
||||
|
||||
from .links import (
|
||||
link_cabinet_list, link_document_cabinet_list,
|
||||
link_document_cabinet_remove, link_cabinet_add_document,
|
||||
link_cabinet_add_multiple_documents, link_cabinet_child_add,
|
||||
link_cabinet_create, link_cabinet_delete, link_cabinet_edit,
|
||||
link_cabinet_view, link_custom_acl_list,
|
||||
link_multiple_document_cabinet_remove
|
||||
link_cabinet_add_document, link_cabinet_add_multiple_documents,
|
||||
link_cabinet_child_add, link_cabinet_create, link_cabinet_delete,
|
||||
link_cabinet_edit, link_cabinet_list, link_cabinet_view,
|
||||
link_custom_acl_list, link_document_cabinet_list,
|
||||
link_document_cabinet_remove, link_multiple_document_cabinet_remove
|
||||
)
|
||||
from .menus import menu_cabinets
|
||||
from .permissions import (
|
||||
|
||||
@@ -15,7 +15,7 @@ from .icons import (
|
||||
from .permissions import (
|
||||
permission_cabinet_add_document, permission_cabinet_create,
|
||||
permission_cabinet_delete, permission_cabinet_edit,
|
||||
permission_cabinet_view, permission_cabinet_remove_document
|
||||
permission_cabinet_remove_document, permission_cabinet_view
|
||||
)
|
||||
|
||||
# Document links
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.10.5 on 2017-01-24 07:37
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
import mptt.fields
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ from ..permissions import (
|
||||
permission_cabinet_delete, permission_cabinet_edit,
|
||||
permission_cabinet_remove_document, permission_cabinet_view
|
||||
)
|
||||
from .literals import TEST_CABINET_LABEL, TEST_CABINET_EDITED_LABEL
|
||||
|
||||
from .literals import TEST_CABINET_EDITED_LABEL, TEST_CABINET_LABEL
|
||||
|
||||
|
||||
class CabinetViewTestCase(GenericDocumentViewTestCase):
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
from mayan.apps.documents.models import Document
|
||||
from mayan.apps.documents.permissions import permission_document_create
|
||||
from mayan.apps.documents.tests import (
|
||||
GenericDocumentViewTestCase, TEST_SMALL_DOCUMENT_PATH,
|
||||
TEST_SMALL_DOCUMENT_PATH, GenericDocumentViewTestCase
|
||||
)
|
||||
from mayan.apps.sources.models import WebFormSource
|
||||
from mayan.apps.sources.tests.literals import (
|
||||
|
||||
@@ -3,13 +3,14 @@ from __future__ import unicode_literals
|
||||
from django.conf.urls import url
|
||||
|
||||
from .api_views import (
|
||||
APIDocumentCabinetListView, APICabinetDocumentListView,
|
||||
APICabinetDocumentView, APICabinetListView, APICabinetView
|
||||
APICabinetDocumentListView, APICabinetDocumentView, APICabinetListView,
|
||||
APICabinetView, APIDocumentCabinetListView
|
||||
)
|
||||
from .views import (
|
||||
CabinetChildAddView, CabinetCreateView, CabinetDeleteView,
|
||||
CabinetDetailView, CabinetEditView, CabinetListView,
|
||||
DocumentAddToCabinetView, DocumentCabinetListView,
|
||||
DocumentRemoveFromCabinetView, CabinetChildAddView, CabinetCreateView,
|
||||
CabinetDeleteView, CabinetDetailView, CabinetEditView, CabinetListView,
|
||||
DocumentRemoveFromCabinetView
|
||||
)
|
||||
|
||||
urlpatterns = [
|
||||
|
||||
@@ -6,15 +6,16 @@ from django.contrib import messages
|
||||
from django.shortcuts import get_object_or_404
|
||||
from django.template import RequestContext
|
||||
from django.urls import reverse_lazy
|
||||
from django.utils.translation import ugettext_lazy as _, ungettext
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext
|
||||
|
||||
from mayan.apps.acls.models import AccessControlList
|
||||
from mayan.apps.common.views import (
|
||||
MultipleObjectFormActionView, SingleObjectCreateView,
|
||||
SingleObjectDeleteView, SingleObjectEditView, SingleObjectListView
|
||||
)
|
||||
from mayan.apps.documents.permissions import permission_document_view
|
||||
from mayan.apps.documents.models import Document
|
||||
from mayan.apps.documents.permissions import permission_document_view
|
||||
from mayan.apps.documents.views import DocumentListView
|
||||
|
||||
from .forms import CabinetListForm
|
||||
@@ -26,7 +27,7 @@ from .models import Cabinet
|
||||
from .permissions import (
|
||||
permission_cabinet_add_document, permission_cabinet_create,
|
||||
permission_cabinet_delete, permission_cabinet_edit,
|
||||
permission_cabinet_view, permission_cabinet_remove_document
|
||||
permission_cabinet_remove_document, permission_cabinet_view
|
||||
)
|
||||
from .widgets import jstree_data
|
||||
|
||||
|
||||
@@ -9,7 +9,9 @@ from django.db.models.signals import pre_save
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.acls import ModelPermission
|
||||
from mayan.apps.common import MayanAppConfig, menu_facet, menu_main, menu_sidebar
|
||||
from mayan.apps.common import (
|
||||
MayanAppConfig, menu_facet, menu_main, menu_sidebar
|
||||
)
|
||||
from mayan.apps.common.dashboards import dashboard_main
|
||||
from mayan.apps.events import ModelEventType
|
||||
from mayan.celery import app
|
||||
@@ -30,8 +32,8 @@ from .permissions import (
|
||||
permission_document_checkout, permission_document_checkout_detail_view
|
||||
)
|
||||
from .queues import * # NOQA
|
||||
from .tasks import task_check_expired_check_outs # NOQA
|
||||
# This import is required so that celerybeat can find the task
|
||||
from .tasks import task_check_expired_check_outs # NOQA
|
||||
|
||||
|
||||
class CheckoutsApp(MayanAppConfig):
|
||||
|
||||
@@ -6,8 +6,8 @@ from mayan.apps.navigation import Link
|
||||
|
||||
from .icons import icon_checkout_info
|
||||
from .permissions import (
|
||||
permission_document_checkout, permission_document_checkin,
|
||||
permission_document_checkin_override
|
||||
permission_document_checkin, permission_document_checkin_override,
|
||||
permission_document_checkout
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from .events import (
|
||||
event_document_forceful_check_in
|
||||
)
|
||||
from .exceptions import DocumentNotCheckedOut
|
||||
from .literals import STATE_CHECKED_OUT, STATE_CHECKED_IN
|
||||
from .literals import STATE_CHECKED_IN, STATE_CHECKED_OUT
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# Generated by Django 1.9.11 on 2016-12-22 05:34
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -8,8 +8,8 @@ from django.utils.timezone import now
|
||||
|
||||
from rest_framework import status
|
||||
|
||||
from mayan.apps.documents.tests import DocumentTestMixin
|
||||
from mayan.apps.documents.permissions import permission_document_view
|
||||
from mayan.apps.documents.tests import DocumentTestMixin
|
||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||
|
||||
from ..models import DocumentCheckout
|
||||
|
||||
@@ -9,8 +9,8 @@ from mayan.apps.common.literals import TIME_DELTA_UNIT_DAYS
|
||||
from mayan.apps.documents.tests import GenericDocumentViewTestCase
|
||||
from mayan.apps.sources.links import link_upload_version
|
||||
from mayan.apps.user_management.tests import (
|
||||
TEST_USER_PASSWORD, TEST_USER_USERNAME, TEST_ADMIN_PASSWORD,
|
||||
TEST_ADMIN_USERNAME,
|
||||
TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME, TEST_USER_PASSWORD,
|
||||
TEST_USER_USERNAME
|
||||
)
|
||||
|
||||
from ..models import DocumentCheckout
|
||||
|
||||
@@ -4,7 +4,7 @@ from django.conf.urls import url
|
||||
|
||||
from .api_views import APICheckedoutDocumentListView, APICheckedoutDocumentView
|
||||
from .views import (
|
||||
CheckoutDocumentView, CheckoutDetailView, CheckoutListView,
|
||||
CheckoutDetailView, CheckoutDocumentView, CheckoutListView,
|
||||
DocumentCheckinView
|
||||
)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ from mayan.apps.documents.models import Document
|
||||
from mayan.apps.documents.views import DocumentListView
|
||||
|
||||
from .exceptions import DocumentAlreadyCheckedOut, DocumentNotCheckedOut
|
||||
from .forms import DocumentCheckoutForm, DocumentCheckoutDefailForm
|
||||
from .forms import DocumentCheckoutDefailForm, DocumentCheckoutForm
|
||||
from .icons import icon_checkout_info
|
||||
from .models import DocumentCheckout
|
||||
from .permissions import (
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from __future__ import absolute_import, unicode_literals
|
||||
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
import os
|
||||
import warnings
|
||||
from datetime import timedelta
|
||||
|
||||
from kombu import Exchange, Queue
|
||||
|
||||
@@ -19,21 +19,18 @@ from mayan.celery import app
|
||||
|
||||
from .classes import Template
|
||||
from .handlers import (
|
||||
handler_pre_initial_setup, handler_pre_upgrade,
|
||||
user_locale_profile_session_config, user_locale_profile_create
|
||||
handler_pre_initial_setup, handler_pre_upgrade, user_locale_profile_create,
|
||||
user_locale_profile_session_config
|
||||
)
|
||||
from .licenses import * # NOQA
|
||||
from .links import (
|
||||
link_about, link_check_version, link_current_user_details,
|
||||
link_current_user_edit, link_current_user_locale_profile_edit,
|
||||
link_license, link_object_error_list_clear, link_packages_licenses,
|
||||
link_setup, link_tools, separator_user_label, text_user_label
|
||||
)
|
||||
|
||||
from .literals import DELETE_STALE_UPLOADS_INTERVAL, MESSAGE_SQLITE_WARNING
|
||||
from .menus import (
|
||||
menu_about, menu_main, menu_secondary, menu_user
|
||||
)
|
||||
from .licenses import * # NOQA
|
||||
from .menus import menu_about, menu_main, menu_secondary, menu_user
|
||||
from .queues import * # NOQA - Force queues registration
|
||||
from .settings import (
|
||||
setting_auto_logging, setting_production_error_log_path,
|
||||
|
||||
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
|
||||
from io import BytesIO
|
||||
import tarfile
|
||||
import zipfile
|
||||
|
||||
try:
|
||||
import zlib # NOQA
|
||||
COMPRESSION = zipfile.ZIP_DEFLATED
|
||||
|
||||
@@ -7,9 +7,9 @@ from django.core.exceptions import ImproperlyConfigured
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views.generic import (
|
||||
FormView as DjangoFormView, DetailView, TemplateView
|
||||
)
|
||||
from django.views.generic import DetailView
|
||||
from django.views.generic import FormView as DjangoFormView
|
||||
from django.views.generic import TemplateView
|
||||
from django.views.generic.detail import SingleObjectMixin
|
||||
from django.views.generic.edit import (
|
||||
CreateView, DeleteView, FormMixin, ModelFormMixin, UpdateView
|
||||
@@ -29,7 +29,6 @@ from .mixins import (
|
||||
ObjectListPermissionFilterMixin, ObjectNameMixin,
|
||||
ObjectPermissionCheckMixin, RedirectionMixin, ViewPermissionCheckMixin
|
||||
)
|
||||
|
||||
from .settings import setting_paginate_by
|
||||
|
||||
__all__ = (
|
||||
|
||||
@@ -9,10 +9,9 @@ from mayan.apps.navigation.classes import Separator, Text
|
||||
from .icons import (
|
||||
icon_about, icon_check_version, icon_current_user_details,
|
||||
icon_current_user_edit, icon_current_user_locale_profile_details,
|
||||
icon_current_user_locale_profile_edit, icon_documentation,
|
||||
icon_forum, icon_license, icon_object_error_list_with_icon,
|
||||
icon_packages_licenses, icon_setup, icon_source_code, icon_support,
|
||||
icon_tools
|
||||
icon_current_user_locale_profile_edit, icon_documentation, icon_forum,
|
||||
icon_license, icon_object_error_list_with_icon, icon_packages_licenses,
|
||||
icon_setup, icon_source_code, icon_support, icon_tools
|
||||
)
|
||||
from .permissions_runtime import permission_error_log_view
|
||||
from .utils import get_user_label_text
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.conf import settings
|
||||
from django.core.files.storage import FileSystemStorage
|
||||
from django.db import migrations, models
|
||||
|
||||
import mayan.apps.common.models
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,8 +2,8 @@
|
||||
# Generated by Django 1.10.7 on 2017-08-25 06:52
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -17,12 +17,41 @@ class Migration(migrations.Migration):
|
||||
migrations.CreateModel(
|
||||
name='ErrorLogEntry',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('namespace', models.CharField(max_length=128, verbose_name='Namespace')),
|
||||
('object_id', models.PositiveIntegerField(blank=True, null=True)),
|
||||
('datetime', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Date time')),
|
||||
('result', models.TextField(blank=True, null=True, verbose_name='Result')),
|
||||
('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='error_log_content_type', to='contenttypes.ContentType')),
|
||||
(
|
||||
'id', models.AutoField(
|
||||
auto_created=True, primary_key=True, serialize=False,
|
||||
verbose_name='ID'
|
||||
)
|
||||
),
|
||||
(
|
||||
'namespace', models.CharField(
|
||||
max_length=128, verbose_name='Namespace'
|
||||
)
|
||||
),
|
||||
(
|
||||
'object_id', models.PositiveIntegerField(
|
||||
blank=True, null=True
|
||||
)
|
||||
),
|
||||
(
|
||||
'datetime', models.DateTimeField(
|
||||
auto_now_add=True, db_index=True,
|
||||
verbose_name='Date time'
|
||||
)
|
||||
),
|
||||
(
|
||||
'result', models.TextField(
|
||||
blank=True, null=True, verbose_name='Result'
|
||||
)
|
||||
),
|
||||
(
|
||||
'content_type', models.ForeignKey(
|
||||
blank=True, null=True,
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='error_log_content_type',
|
||||
to='contenttypes.ContentType'
|
||||
)
|
||||
),
|
||||
],
|
||||
options={
|
||||
'ordering': ('datetime',),
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -1,11 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-04-03 07:02
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import mayan.apps.common.models
|
||||
import django.core.files.storage
|
||||
from django.db import migrations, models
|
||||
|
||||
import mayan.apps.common.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -17,6 +16,11 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='shareduploadedfile',
|
||||
name='file',
|
||||
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location=b'mayan/media/shared_files'), upload_to=mayan.apps.common.models.upload_to, verbose_name='File'),
|
||||
field=models.FileField(
|
||||
storage=django.core.files.storage.FileSystemStorage(
|
||||
location=b'mayan/media/shared_files'
|
||||
), upload_to=mayan.apps.common.models.upload_to,
|
||||
verbose_name='File'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.11 on 2018-04-29 07:58
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import mayan.apps.common.models
|
||||
import django.core.files.storage
|
||||
from django.db import migrations, models
|
||||
|
||||
import mayan.apps.common.models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -17,6 +16,11 @@ class Migration(migrations.Migration):
|
||||
migrations.AlterField(
|
||||
model_name='shareduploadedfile',
|
||||
name='file',
|
||||
field=models.FileField(storage=django.core.files.storage.FileSystemStorage(location=b'/home/rosarior/development/mayan-edms/mayan/media/shared_files'), upload_to=mayan.apps.common.models.upload_to, verbose_name='File'),
|
||||
field=models.FileField(
|
||||
storage=django.core.files.storage.FileSystemStorage(
|
||||
location=b'/home/rosarior/development/mayan-edms/mayan/media/shared_files'
|
||||
), upload_to=mayan.apps.common.models.upload_to,
|
||||
verbose_name='File'
|
||||
),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.16 on 2018-12-03 08:12
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
@@ -16,11 +14,33 @@ class Migration(migrations.Migration):
|
||||
migrations.CreateModel(
|
||||
name='Cache',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=128, unique=True, verbose_name='Name')),
|
||||
('label', models.CharField(max_length=128, verbose_name='Label')),
|
||||
('maximum_size', models.PositiveIntegerField(verbose_name='Maximum size')),
|
||||
('storage_instance_path', models.CharField(max_length=255, unique=True, verbose_name='Storage instance path')),
|
||||
(
|
||||
'id', models.AutoField(
|
||||
auto_created=True, primary_key=True, serialize=False,
|
||||
verbose_name='ID'
|
||||
)
|
||||
),
|
||||
(
|
||||
'name', models.CharField(
|
||||
max_length=128, unique=True, verbose_name='Name'
|
||||
)
|
||||
),
|
||||
(
|
||||
'label', models.CharField(
|
||||
max_length=128, verbose_name='Label'
|
||||
)
|
||||
),
|
||||
(
|
||||
'maximum_size', models.PositiveIntegerField(
|
||||
verbose_name='Maximum size'
|
||||
)
|
||||
),
|
||||
(
|
||||
'storage_instance_path', models.CharField(
|
||||
max_length=255, unique=True,
|
||||
verbose_name='Storage instance path'
|
||||
)
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Cache',
|
||||
@@ -30,9 +50,24 @@ class Migration(migrations.Migration):
|
||||
migrations.CreateModel(
|
||||
name='CachePartition',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=128, verbose_name='Name')),
|
||||
('cache', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='partitions', to='common.Cache', verbose_name='Cache')),
|
||||
(
|
||||
'id', models.AutoField(
|
||||
auto_created=True, primary_key=True, serialize=False,
|
||||
verbose_name='ID'
|
||||
)
|
||||
),
|
||||
(
|
||||
'name', models.CharField(
|
||||
max_length=128, verbose_name='Name'
|
||||
)
|
||||
),
|
||||
(
|
||||
'cache', models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='partitions', to='common.Cache',
|
||||
verbose_name='Cache'
|
||||
)
|
||||
),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Cache partition',
|
||||
@@ -42,11 +77,35 @@ class Migration(migrations.Migration):
|
||||
migrations.CreateModel(
|
||||
name='CachePartitionFile',
|
||||
fields=[
|
||||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('datetime', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='Date time')),
|
||||
('filename', models.CharField(max_length=255, verbose_name='Filename')),
|
||||
('file_size', models.PositiveIntegerField(default=0, verbose_name='File size')),
|
||||
('partition', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='files', to='common.CachePartition', verbose_name='Cache partition')),
|
||||
(
|
||||
'id', models.AutoField(
|
||||
auto_created=True, primary_key=True, serialize=False,
|
||||
verbose_name='ID'
|
||||
)
|
||||
),
|
||||
(
|
||||
'datetime', models.DateTimeField(
|
||||
auto_now_add=True, db_index=True,
|
||||
verbose_name='Date time'
|
||||
)
|
||||
),
|
||||
(
|
||||
'filename', models.CharField(
|
||||
max_length=255, verbose_name='Filename'
|
||||
)
|
||||
),
|
||||
(
|
||||
'file_size', models.PositiveIntegerField(
|
||||
default=0, verbose_name='File size'
|
||||
)
|
||||
),
|
||||
(
|
||||
'partition', models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name='files', to='common.CachePartition',
|
||||
verbose_name='Cache partition'
|
||||
)
|
||||
),
|
||||
],
|
||||
options={
|
||||
'get_latest_by': 'datetime',
|
||||
|
||||
@@ -6,7 +6,8 @@ from django.core.exceptions import PermissionDenied
|
||||
from django.db.models.query import QuerySet
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import resolve_url
|
||||
from django.utils.translation import ungettext, ugettext_lazy as _
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ungettext
|
||||
|
||||
from mayan.apps.acls.models import AccessControlList
|
||||
from mayan.apps.permissions import Permission
|
||||
|
||||
@@ -2,9 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
from .settings import (
|
||||
setting_shared_storage, setting_shared_storage_arguments
|
||||
)
|
||||
from .settings import setting_shared_storage, setting_shared_storage_arguments
|
||||
|
||||
storage_sharedupload = import_string(
|
||||
dotted_path=setting_shared_storage.value
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
|
||||
from django.apps import apps
|
||||
from django.utils.timezone import now
|
||||
|
||||
@@ -7,14 +7,13 @@ from django.template import Context, Template
|
||||
from django.test import TestCase
|
||||
from django.test.utils import ContextList
|
||||
from django.urls import clear_url_caches, reverse
|
||||
|
||||
from django_downloadview import assert_download_response
|
||||
|
||||
from mayan.apps.permissions.classes import Permission
|
||||
from mayan.apps.smart_settings.classes import Namespace
|
||||
from mayan.apps.user_management.tests import (
|
||||
TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME, TEST_USER_USERNAME,
|
||||
TEST_USER_PASSWORD
|
||||
TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME, TEST_USER_PASSWORD,
|
||||
TEST_USER_USERNAME
|
||||
)
|
||||
|
||||
from .literals import TEST_VIEW_NAME, TEST_VIEW_URL
|
||||
|
||||
@@ -12,8 +12,9 @@ from mayan.apps.acls.models import AccessControlList
|
||||
from mayan.apps.permissions.models import Role
|
||||
from mayan.apps.permissions.tests.literals import TEST_ROLE_LABEL
|
||||
from mayan.apps.user_management.tests import (
|
||||
TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME, TEST_ADMIN_EMAIL,
|
||||
TEST_GROUP_NAME, TEST_USER_EMAIL, TEST_USER_USERNAME, TEST_USER_PASSWORD
|
||||
TEST_ADMIN_EMAIL, TEST_ADMIN_PASSWORD, TEST_ADMIN_USERNAME,
|
||||
TEST_GROUP_NAME, TEST_USER_EMAIL, TEST_USER_PASSWORD,
|
||||
TEST_USER_USERNAME
|
||||
)
|
||||
|
||||
from ..settings import setting_temporary_directory
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.urls import reverse
|
||||
from django.test import override_settings
|
||||
from django.urls import reverse
|
||||
|
||||
from mayan.apps.rest_api.tests import BaseAPITestCase
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from mayan.apps.common.tests import BaseTestCase
|
||||
from ..compressed_files import Archive, TarArchive, ZipArchive
|
||||
|
||||
from .literals import (
|
||||
TEST_COMPRESSED_FILE_CONTENTS, TEST_FILE_CONTENTS_1, TEST_FILE3_PATH,
|
||||
TEST_COMPRESSED_FILE_CONTENTS, TEST_FILE3_PATH, TEST_FILE_CONTENTS_1,
|
||||
TEST_FILENAME1, TEST_FILENAME3, TEST_TAR_BZ2_FILE_PATH,
|
||||
TEST_TAR_FILE_PATH, TEST_TAR_GZ_FILE_PATH, TEST_ZIP_FILE_PATH
|
||||
)
|
||||
|
||||
@@ -10,10 +10,10 @@ from django.conf import settings
|
||||
from django.urls import resolve as django_resolve
|
||||
from django.urls.base import get_script_prefix
|
||||
from django.utils.datastructures import MultiValueDict
|
||||
from django.utils.http import (
|
||||
urlencode as django_urlencode, urlquote as django_urlquote
|
||||
)
|
||||
from django.utils.six.moves import reduce as reduce_function, xmlrpc_client
|
||||
from django.utils.http import urlencode as django_urlencode
|
||||
from django.utils.http import urlquote as django_urlquote
|
||||
from django.utils.six.moves import reduce as reduce_function
|
||||
from django.utils.six.moves import xmlrpc_client
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
import mayan
|
||||
|
||||
@@ -23,14 +23,13 @@ from .forms import (
|
||||
)
|
||||
from .generics import ( # NOQA
|
||||
AssignRemoveView, ConfirmView, FormView, MultiFormView,
|
||||
MultipleObjectConfirmActionView, MultipleObjectFormActionView,
|
||||
SingleObjectCreateView, SingleObjectDeleteView,
|
||||
SingleObjectDetailView, SingleObjectDynamicFormCreateView,
|
||||
SingleObjectDynamicFormEditView, SingleObjectDownloadView,
|
||||
SingleObjectEditView, SingleObjectListView, SimpleView
|
||||
MultipleObjectConfirmActionView, MultipleObjectFormActionView, SimpleView,
|
||||
SingleObjectCreateView, SingleObjectDeleteView, SingleObjectDetailView,
|
||||
SingleObjectDownloadView, SingleObjectDynamicFormCreateView,
|
||||
SingleObjectDynamicFormEditView, SingleObjectEditView, SingleObjectListView
|
||||
)
|
||||
from .icons import icon_setup
|
||||
from .menus import menu_tools, menu_setup
|
||||
from .menus import menu_setup, menu_tools
|
||||
from .permissions_runtime import permission_error_log_view
|
||||
from .utils import check_version
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ from django.utils.encoding import force_text
|
||||
from django.utils.html import format_html
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
from .icons import icon_fail as default_icon_fail, icon_ok as default_icon_ok
|
||||
from .icons import icon_fail as default_icon_fail
|
||||
from .icons import icon_ok as default_icon_ok
|
||||
|
||||
|
||||
class DisableableSelectWidget(forms.SelectMultiple):
|
||||
|
||||
@@ -1,14 +1,21 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import platform
|
||||
|
||||
CHUNK_SIZE = 1024
|
||||
|
||||
DEFAULT_ZOOM_LEVEL = 100
|
||||
DEFAULT_ROTATION = 0
|
||||
DEFAULT_PAGE_NUMBER = 1
|
||||
DEFAULT_PILLOW_FORMAT = 'JPEG'
|
||||
DEFAULT_LIBREOFFICE_PATH = '/usr/bin/libreoffice'
|
||||
if platform.system() == 'OpenBSD':
|
||||
DEFAULT_LIBREOFFICE_PATH = '/usr/local/bin/libreoffice'
|
||||
DEFAULT_PDFINFO_PATH = '/usr/local/bin/pdfinfo'
|
||||
DEFAULT_PDFTOPPM_PATH = '/usr/local/bin/pdftoppm'
|
||||
else:
|
||||
DEFAULT_LIBREOFFICE_PATH = '/usr/bin/libreoffice'
|
||||
DEFAULT_PDFINFO_PATH = '/usr/bin/pdfinfo'
|
||||
DEFAULT_PDFTOPPM_PATH = '/usr/bin/pdftoppm'
|
||||
|
||||
DEFAULT_PAGE_NUMBER = 1
|
||||
DEFAULT_PDFTOPPM_DPI = 300
|
||||
DEFAULT_PDFTOPPM_FORMAT = 'jpeg' # Possible values jpeg, png, tiff
|
||||
DEFAULT_PDFTOPPM_PATH = '/usr/bin/pdftoppm'
|
||||
DEFAULT_PDFINFO_PATH = '/usr/bin/pdfinfo'
|
||||
DEFAULT_PILLOW_FORMAT = 'JPEG'
|
||||
DEFAULT_ROTATION = 0
|
||||
DEFAULT_ZOOM_LEVEL = 100
|
||||
|
||||
@@ -10,7 +10,8 @@ from mayan.apps.common.utils import mkdtemp
|
||||
|
||||
|
||||
class GPGBackend(object):
|
||||
def __init__(self, **kwargs):
|
||||
def __init__(self, gpg_path, **kwargs):
|
||||
self.gpg_path = gpg_path
|
||||
self.kwargs = kwargs
|
||||
|
||||
|
||||
@@ -76,7 +77,7 @@ class PythonGNUPGBackend(GPGBackend):
|
||||
os.chmod(temporary_directory, 0x1C0)
|
||||
|
||||
gpg = gnupg.GPG(
|
||||
gnupghome=temporary_directory, gpgbinary=self.kwargs['binary_path']
|
||||
gnupghome=temporary_directory, gpgbinary=self.gpg_path
|
||||
)
|
||||
|
||||
result = function(gpg=gpg, **kwargs)
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import platform
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
if platform.system() == 'OpenBSD':
|
||||
DEFAULT_GPG_PATH = '/usr/local/bin/gpg'
|
||||
else:
|
||||
DEFAULT_GPG_PATH = '/usr/bin/gpg1'
|
||||
|
||||
DEFAULT_SETTING_GPG_BACKEND = 'mayan.apps.django_gpg.classes.PythonGNUPGBackend'
|
||||
|
||||
ERROR_MSG_BAD_PASSPHRASE = 'BAD_PASSPHRASE'
|
||||
ERROR_MSG_MISSING_PASSPHRASE = 'MISSING_PASSPHRASE'
|
||||
|
||||
KEY_TYPES = {
|
||||
'pub': _('Public'),
|
||||
'sec': _('Secret'),
|
||||
@@ -31,13 +43,14 @@ KEY_SECONDARY_CLASSES = (
|
||||
|
||||
KEYSERVER_DEFAULT_PORT = 11371
|
||||
|
||||
OUTPUT_MESSAGE_CONTAINS_PRIVATE_KEY = 'Contains private key'
|
||||
|
||||
SIGNATURE_STATE_BAD = 'signature bad'
|
||||
SIGNATURE_STATE_NONE = None
|
||||
SIGNATURE_STATE_ERROR = 'signature error'
|
||||
SIGNATURE_STATE_NO_PUBLIC_KEY = 'no public key'
|
||||
SIGNATURE_STATE_GOOD = 'signature good'
|
||||
SIGNATURE_STATE_VALID = 'signature valid'
|
||||
|
||||
SIGNATURE_STATES = {
|
||||
SIGNATURE_STATE_BAD: {
|
||||
'text': _('Bad signature.'),
|
||||
@@ -61,8 +74,3 @@ SIGNATURE_STATES = {
|
||||
'text': _('Document is signed with a valid signature.'),
|
||||
},
|
||||
}
|
||||
|
||||
ERROR_MSG_NEED_PASSPHRASE = 'NEED_PASSPHRASE'
|
||||
ERROR_MSG_BAD_PASSPHRASE = 'BAD_PASSPHRASE'
|
||||
ERROR_MSG_GOOD_PASSPHRASE = 'GOOD_PASSPHRASE'
|
||||
OUTPUT_MESSAGE_CONTAINS_PRIVATE_KEY = 'Contains private key'
|
||||
|
||||
@@ -11,9 +11,8 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from .exceptions import NeedPassphrase, PassphraseError
|
||||
from .literals import (
|
||||
ERROR_MSG_NEED_PASSPHRASE, ERROR_MSG_BAD_PASSPHRASE,
|
||||
ERROR_MSG_GOOD_PASSPHRASE, KEY_TYPE_CHOICES, KEY_TYPE_SECRET,
|
||||
OUTPUT_MESSAGE_CONTAINS_PRIVATE_KEY
|
||||
ERROR_MSG_BAD_PASSPHRASE, ERROR_MSG_MISSING_PASSPHRASE,
|
||||
KEY_TYPE_CHOICES, KEY_TYPE_SECRET, OUTPUT_MESSAGE_CONTAINS_PRIVATE_KEY
|
||||
)
|
||||
from .managers import KeyManager
|
||||
from .runtime import gpg_backend
|
||||
@@ -124,10 +123,10 @@ class Key(models.Model):
|
||||
|
||||
logger.debug('file_sign_results.stderr: %s', file_sign_results.stderr)
|
||||
|
||||
if ERROR_MSG_NEED_PASSPHRASE in file_sign_results.stderr:
|
||||
if ERROR_MSG_BAD_PASSPHRASE in file_sign_results.stderr:
|
||||
raise PassphraseError
|
||||
elif ERROR_MSG_GOOD_PASSPHRASE not in file_sign_results.stderr:
|
||||
raise NeedPassphrase
|
||||
if ERROR_MSG_MISSING_PASSPHRASE in file_sign_results.stderr:
|
||||
raise NeedPassphrase
|
||||
|
||||
if ERROR_MSG_BAD_PASSPHRASE in file_sign_results.stderr:
|
||||
raise PassphraseError
|
||||
|
||||
return file_sign_results
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
from .settings import setting_gpg_path
|
||||
|
||||
# TODO: This will become an setting option in 2.2
|
||||
SETTING_GPG_BACKEND = 'mayan.apps.django_gpg.classes.PythonGNUPGBackend'
|
||||
|
||||
gpg_backend = import_string(SETTING_GPG_BACKEND)(
|
||||
binary_path=setting_gpg_path.value
|
||||
from .settings import (
|
||||
setting_gpg_backend, setting_gpg_backend_arguments
|
||||
)
|
||||
|
||||
gpg_backend = import_string(
|
||||
dotted_path=setting_gpg_backend.value
|
||||
)(**setting_gpg_backend_arguments.value)
|
||||
|
||||
@@ -1,24 +1,26 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.smart_settings import Namespace
|
||||
|
||||
from .literals import DEFAULT_GPG_PATH, DEFAULT_SETTING_GPG_BACKEND
|
||||
|
||||
namespace = Namespace(name='django_gpg', label=_('Signatures'))
|
||||
setting_gpg_home = namespace.add_setting(
|
||||
global_name='SIGNATURES_GPG_HOME',
|
||||
default=os.path.join(settings.MEDIA_ROOT, 'gpg_home'),
|
||||
help_text=_(
|
||||
'Home directory used to store keys as well as configuration files.'
|
||||
),
|
||||
is_path=True
|
||||
|
||||
setting_gpg_backend = namespace.add_setting(
|
||||
default=DEFAULT_SETTING_GPG_BACKEND,
|
||||
global_name='SIGNATURES_GPG_BACKEND', help_text=_(
|
||||
'Path to the GPG class to use when managing keys.'
|
||||
)
|
||||
)
|
||||
setting_gpg_path = namespace.add_setting(
|
||||
global_name='SIGNATURES_GPG_PATH', default='/usr/bin/gpg1',
|
||||
help_text=_('Path to the GPG binary.'), is_path=True
|
||||
setting_gpg_backend_arguments = namespace.add_setting(
|
||||
global_name='SIGNATURES_GPG_BACKEND_ARGUMENTS',
|
||||
default={
|
||||
'gpg_path': DEFAULT_GPG_PATH
|
||||
}, help_text=_(
|
||||
'Arguments to pass to the SIGNATURES_GPG_BACKEND. '
|
||||
)
|
||||
)
|
||||
setting_keyserver = namespace.add_setting(
|
||||
global_name='SIGNATURES_KEYSERVER', default='pool.sks-keyservers.net',
|
||||
|
||||
8
mayan/apps/document_parsing/literals.py
Normal file
8
mayan/apps/document_parsing/literals.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import platform
|
||||
|
||||
if platform.system() == 'OpenBSD':
|
||||
DEFAULT_PDFTOTEXT_PATH = '/usr/local/bin/pdftotext'
|
||||
else:
|
||||
DEFAULT_PDFTOTEXT_PATH = '/usr/bin/pdftotext'
|
||||
@@ -4,6 +4,8 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.smart_settings import Namespace
|
||||
|
||||
from .literals import DEFAULT_PDFTOTEXT_PATH
|
||||
|
||||
namespace = Namespace(name='document_parsing', label=_('Document parsing'))
|
||||
|
||||
setting_auto_parsing = namespace.add_setting(
|
||||
@@ -14,7 +16,7 @@ setting_auto_parsing = namespace.add_setting(
|
||||
)
|
||||
setting_pdftotext_path = namespace.add_setting(
|
||||
global_name='DOCUMENT_PARSING_PDFTOTEXT_PATH',
|
||||
default='/usr/bin/pdftotext',
|
||||
default=DEFAULT_PDFTOTEXT_PATH,
|
||||
help_text=_(
|
||||
'File path to poppler\'s pdftotext program used to extract text '
|
||||
'from PDF files.'
|
||||
|
||||
@@ -10,13 +10,13 @@ from mayan.apps.smart_settings import Namespace
|
||||
namespace = Namespace(name='signatures', label=_('Document signatures'))
|
||||
setting_storage_backend = namespace.add_setting(
|
||||
default='django.core.files.storage.FileSystemStorage',
|
||||
global_name='SIGNATURES_STORAGE_BACKEND', help_text=_(
|
||||
global_name='DOCUMENT_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',
|
||||
global_name='DOCUMENT_SIGNATURES_STORAGE_BACKEND_ARGUMENTS',
|
||||
default={
|
||||
'location': os.path.join(settings.MEDIA_ROOT, 'document_signatures')
|
||||
}, help_text=_(
|
||||
|
||||
@@ -179,7 +179,7 @@ def task_upload_new_version(self, document_id, shared_uploaded_file_id, user_id,
|
||||
)
|
||||
|
||||
try:
|
||||
document = Document.objects.get(pk=document_id)
|
||||
document = Document.passthrough.get(pk=document_id)
|
||||
shared_file = SharedUploadedFile.objects.get(
|
||||
pk=shared_uploaded_file_id
|
||||
)
|
||||
|
||||
@@ -3,7 +3,8 @@ from __future__ import unicode_literals
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import (
|
||||
IMAPEmail, POP3Email, StagingFolderSource, WatchFolderSource, WebFormSource
|
||||
IMAPEmail, POP3Email, StagingFolderSource, WatchFolderSource,
|
||||
WebFormSource
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from kombu import Exchange, Queue
|
||||
|
||||
from mayan.apps.common import (
|
||||
MayanAppConfig, MissingItem, menu_list_facet, menu_object, menu_secondary,
|
||||
menu_sidebar, menu_setup
|
||||
menu_setup, menu_sidebar
|
||||
)
|
||||
from mayan.apps.common.signals import post_initial_setup, post_upgrade
|
||||
from mayan.apps.converter.links import link_transformation_list
|
||||
@@ -21,13 +21,13 @@ from .handlers import (
|
||||
initialize_periodic_tasks
|
||||
)
|
||||
from .links import (
|
||||
link_document_create_multiple, link_setup_sources,
|
||||
link_setup_source_check_now, link_setup_source_create_imap_email,
|
||||
link_setup_source_create_pop3_email, link_setup_source_create_sane_scanner,
|
||||
link_document_create_multiple, link_setup_source_check_now,
|
||||
link_setup_source_create_imap_email, link_setup_source_create_pop3_email,
|
||||
link_setup_source_create_sane_scanner,
|
||||
link_setup_source_create_staging_folder,
|
||||
link_setup_source_create_watch_folder, link_setup_source_create_webform,
|
||||
link_setup_source_create_staging_folder, link_setup_source_delete,
|
||||
link_setup_source_edit, link_setup_source_logs, link_staging_file_delete,
|
||||
link_upload_version
|
||||
link_setup_source_delete, link_setup_source_edit, link_setup_source_logs,
|
||||
link_setup_sources, link_staging_file_delete, link_upload_version
|
||||
)
|
||||
from .queues import * # NOQA
|
||||
from .widgets import StagingFileThumbnailWidget
|
||||
|
||||
@@ -10,8 +10,8 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from mayan.apps.documents.forms import DocumentForm
|
||||
|
||||
from .models import (
|
||||
IMAPEmail, POP3Email, SaneScanner, StagingFolderSource, WebFormSource,
|
||||
WatchFolderSource
|
||||
IMAPEmail, POP3Email, SaneScanner, StagingFolderSource, WatchFolderSource,
|
||||
WebFormSource
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -13,8 +13,9 @@ from .icons import (
|
||||
icon_source_create
|
||||
)
|
||||
from .literals import (
|
||||
SOURCE_CHOICE_WEB_FORM, SOURCE_CHOICE_EMAIL_IMAP, SOURCE_CHOICE_EMAIL_POP3,
|
||||
SOURCE_CHOICE_SANE_SCANNER, SOURCE_CHOICE_STAGING, SOURCE_CHOICE_WATCH
|
||||
SOURCE_CHOICE_EMAIL_IMAP, SOURCE_CHOICE_EMAIL_POP3,
|
||||
SOURCE_CHOICE_SANE_SCANNER, SOURCE_CHOICE_STAGING, SOURCE_CHOICE_WATCH,
|
||||
SOURCE_CHOICE_WEB_FORM
|
||||
)
|
||||
from .permissions import (
|
||||
permission_sources_setup_create, permission_sources_setup_delete,
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import platform
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
if platform.system() == 'OpenBSD':
|
||||
DEFAULT_SCANIMAGE_PATH = '/usr/local/bin/scanimage'
|
||||
else:
|
||||
DEFAULT_SCANIMAGE_PATH = '/usr/bin/scanimage'
|
||||
|
||||
DEFAULT_IMAP_MAILBOX = 'INBOX'
|
||||
DEFAULT_INTERVAL = 600
|
||||
DEFAULT_METADATA_ATTACHMENT_NAME = 'metadata.yaml'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# Generated by Django 1.10.5 on 2017-02-05 04:19
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
@@ -19,7 +19,7 @@ from django.utils.encoding import (
|
||||
from django.utils.timezone import now
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from djcelery.models import PeriodicTask, IntervalSchedule
|
||||
from djcelery.models import IntervalSchedule, PeriodicTask
|
||||
from model_utils.managers import InheritanceManager
|
||||
|
||||
from mayan.apps.common.compressed_files import Archive
|
||||
@@ -34,14 +34,14 @@ from mayan.apps.metadata.models import MetadataType
|
||||
from .classes import PseudoFile, SourceUploadedFile, StagingFile
|
||||
from .exceptions import SourceException
|
||||
from .literals import (
|
||||
DEFAULT_INTERVAL, DEFAULT_POP3_TIMEOUT, DEFAULT_IMAP_MAILBOX,
|
||||
DEFAULT_METADATA_ATTACHMENT_NAME, SCANNER_ADF_MODE_CHOICES,
|
||||
SCANNER_MODE_COLOR, SCANNER_MODE_CHOICES, SCANNER_SOURCE_CHOICES,
|
||||
SOURCE_CHOICES, SOURCE_CHOICE_STAGING, SOURCE_CHOICE_WATCH,
|
||||
SOURCE_CHOICE_WEB_FORM, SOURCE_INTERACTIVE_UNCOMPRESS_CHOICES,
|
||||
SOURCE_UNCOMPRESS_CHOICES, SOURCE_UNCOMPRESS_CHOICE_N,
|
||||
SOURCE_UNCOMPRESS_CHOICE_Y, SOURCE_CHOICE_EMAIL_IMAP,
|
||||
DEFAULT_IMAP_MAILBOX, DEFAULT_INTERVAL, DEFAULT_METADATA_ATTACHMENT_NAME,
|
||||
DEFAULT_POP3_TIMEOUT, SCANNER_ADF_MODE_CHOICES, SCANNER_MODE_CHOICES,
|
||||
SCANNER_MODE_COLOR, SCANNER_SOURCE_CHOICES, SOURCE_CHOICE_EMAIL_IMAP,
|
||||
SOURCE_CHOICE_EMAIL_POP3, SOURCE_CHOICE_SANE_SCANNER,
|
||||
SOURCE_CHOICE_STAGING, SOURCE_CHOICE_WATCH, SOURCE_CHOICE_WEB_FORM,
|
||||
SOURCE_CHOICES, SOURCE_INTERACTIVE_UNCOMPRESS_CHOICES,
|
||||
SOURCE_UNCOMPRESS_CHOICE_N, SOURCE_UNCOMPRESS_CHOICE_Y,
|
||||
SOURCE_UNCOMPRESS_CHOICES
|
||||
)
|
||||
from .settings import setting_scanimage_path
|
||||
from .wizards import WizardStep
|
||||
|
||||
@@ -7,10 +7,12 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.apps.smart_settings import Namespace
|
||||
|
||||
from .literals import DEFAULT_SCANIMAGE_PATH
|
||||
|
||||
namespace = Namespace(name='sources', label=_('Sources'))
|
||||
|
||||
setting_scanimage_path = namespace.add_setting(
|
||||
global_name='SOURCES_SCANIMAGE_PATH', default='/usr/bin/scanimage',
|
||||
global_name='SOURCES_SCANIMAGE_PATH', default=DEFAULT_SCANIMAGE_PATH,
|
||||
help_text=_(
|
||||
'File path to the scanimage program used to control image scanners.'
|
||||
),
|
||||
|
||||
@@ -4,7 +4,7 @@ from django.utils.module_loading import import_string
|
||||
|
||||
from .settings import (
|
||||
setting_staging_file_image_cache_storage,
|
||||
setting_staging_file_image_cache_storage_arguments,
|
||||
setting_staging_file_image_cache_storage_arguments
|
||||
)
|
||||
|
||||
storage_staging_file_image_cache = import_string(
|
||||
|
||||
@@ -7,12 +7,11 @@ from django.db import OperationalError
|
||||
from django.utils.encoding import force_text
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from mayan.celery import app
|
||||
|
||||
from mayan.apps.common.compressed_files import Archive
|
||||
from mayan.apps.common.exceptions import NoMIMETypeMatch
|
||||
from mayan.apps.lock_manager import LockError
|
||||
from mayan.apps.lock_manager.runtime import locking_backend
|
||||
from mayan.celery import app
|
||||
|
||||
from .literals import (
|
||||
DEFAULT_SOURCE_LOCK_EXPIRE, DEFAULT_SOURCE_TASK_RETRY_DELAY
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from mayan.apps.documents.tests import GenericDocumentViewTestCase
|
||||
from mayan.apps.documents.permissions import permission_document_create
|
||||
from mayan.apps.documents.tests import GenericDocumentViewTestCase
|
||||
|
||||
from ..links import link_document_create_multiple
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ from pathlib2 import Path
|
||||
from django.test import override_settings
|
||||
from django.utils.encoding import force_text
|
||||
|
||||
from mayan.apps.common.utils import mkdtemp
|
||||
from mayan.apps.common.tests import BaseTestCase
|
||||
from mayan.apps.common.utils import mkdtemp
|
||||
from mayan.apps.documents.models import Document, DocumentType
|
||||
from mayan.apps.documents.tests import (
|
||||
DocumentTestMixin, TEST_COMPRESSED_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL,
|
||||
TEST_NON_ASCII_DOCUMENT_FILENAME, TEST_NON_ASCII_DOCUMENT_PATH,
|
||||
TEST_NON_ASCII_COMPRESSED_DOCUMENT_PATH
|
||||
TEST_COMPRESSED_DOCUMENT_PATH, TEST_DOCUMENT_TYPE_LABEL,
|
||||
TEST_NON_ASCII_COMPRESSED_DOCUMENT_PATH, TEST_NON_ASCII_DOCUMENT_FILENAME,
|
||||
TEST_NON_ASCII_DOCUMENT_PATH, DocumentTestMixin
|
||||
)
|
||||
from mayan.apps.metadata.models import MetadataType
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ from mayan.apps.common.utils import fs_cleanup, mkdtemp
|
||||
from mayan.apps.documents.models import Document, DocumentType
|
||||
from mayan.apps.documents.permissions import permission_document_create
|
||||
from mayan.apps.documents.tests import (
|
||||
GenericDocumentViewTestCase, TEST_DOCUMENT_DESCRIPTION,
|
||||
TEST_DOCUMENT_TYPE_LABEL, TEST_SMALL_DOCUMENT_CHECKSUM,
|
||||
TEST_SMALL_DOCUMENT_PATH,
|
||||
TEST_DOCUMENT_DESCRIPTION, TEST_DOCUMENT_TYPE_LABEL,
|
||||
TEST_SMALL_DOCUMENT_CHECKSUM, TEST_SMALL_DOCUMENT_PATH,
|
||||
GenericDocumentViewTestCase
|
||||
)
|
||||
|
||||
from ..links import link_upload_version
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import unicode_literals
|
||||
from django.conf.urls import url
|
||||
|
||||
from .api_views import (
|
||||
APIStagingSourceFileView, APIStagingSourceFileImageView,
|
||||
APIStagingSourceFileImageView, APIStagingSourceFileView,
|
||||
APIStagingSourceListView, APIStagingSourceView
|
||||
)
|
||||
from .views import (
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from .forms import (
|
||||
POP3EmailSetupForm, IMAPEmailSetupForm, SaneScannerSetupForm,
|
||||
IMAPEmailSetupForm, POP3EmailSetupForm, SaneScannerSetupForm,
|
||||
SaneScannerUploadForm, StagingFolderSetupForm, StagingUploadForm,
|
||||
WatchFolderSetupForm, WebFormSetupForm, WebFormUploadForm
|
||||
)
|
||||
|
||||
@@ -18,11 +18,11 @@ from mayan.apps.common import menu_facet
|
||||
from mayan.apps.common.models import SharedUploadedFile
|
||||
from mayan.apps.common.utils import encapsulate
|
||||
from mayan.apps.common.views import (
|
||||
ConfirmView, MultiFormView, SingleObjectCreateView,
|
||||
SingleObjectDeleteView, SingleObjectEditView, SingleObjectListView
|
||||
ConfirmView, MultiFormView, SingleObjectCreateView, SingleObjectDeleteView,
|
||||
SingleObjectEditView, SingleObjectListView
|
||||
)
|
||||
from mayan.apps.common.widgets import TwoStateWidget
|
||||
from mayan.apps.documents.models import DocumentType, Document
|
||||
from mayan.apps.documents.models import Document, DocumentType
|
||||
from mayan.apps.documents.permissions import (
|
||||
permission_document_create, permission_document_new_version
|
||||
)
|
||||
@@ -34,16 +34,14 @@ from .forms import (
|
||||
NewDocumentForm, NewVersionForm, WebFormUploadForm, WebFormUploadFormHTML5
|
||||
)
|
||||
from .icons import icon_log, icon_setup_sources, icon_upload_view_link
|
||||
from .literals import SOURCE_UNCOMPRESS_CHOICE_ASK, SOURCE_UNCOMPRESS_CHOICE_Y
|
||||
from .links import (
|
||||
link_setup_source_create_imap_email, link_setup_source_create_pop3_email,
|
||||
link_setup_source_create_sane_scanner,
|
||||
link_setup_source_create_staging_folder,
|
||||
link_setup_source_create_watch_folder, link_setup_source_create_webform,
|
||||
link_setup_source_create_sane_scanner
|
||||
)
|
||||
from .models import (
|
||||
InteractiveSource, Source, SaneScanner, StagingFolderSource
|
||||
link_setup_source_create_watch_folder, link_setup_source_create_webform
|
||||
)
|
||||
from .literals import SOURCE_UNCOMPRESS_CHOICE_ASK, SOURCE_UNCOMPRESS_CHOICE_Y
|
||||
from .models import InteractiveSource, SaneScanner, Source, StagingFolderSource
|
||||
from .permissions import (
|
||||
permission_sources_setup_create, permission_sources_setup_delete,
|
||||
permission_sources_setup_edit, permission_sources_setup_view,
|
||||
|
||||
@@ -3,8 +3,8 @@ from __future__ import unicode_literals
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
from mayan.apps.documents.settings import (
|
||||
setting_preview_width, setting_preview_height, setting_thumbnail_width,
|
||||
setting_thumbnail_height
|
||||
setting_preview_height, setting_preview_width, setting_thumbnail_height,
|
||||
setting_thumbnail_width
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user