diff --git a/mayan/__init__.py b/mayan/__init__.py index 4dffd359e1..aaea293b25 100644 --- a/mayan/__init__.py +++ b/mayan/__init__.py @@ -1,9 +1,9 @@ from __future__ import unicode_literals __title__ = 'Mayan EDMS' -__version__ = '3.2.8' +__version__ = '3.3beta1' __build__ = 0x030208 -__build_string__ = 'v3.2.8_Tue Oct 1 13:31:40 2019 -0400' +__build_string__ = 'v3.2.8-245-gce7c805251_Mon Oct 7 11:01:43 2019 -0400' __django_version__ = '1.11' __author__ = 'Roberto Rosario' __author_email__ = 'roberto.rosario@mayan-edms.com' diff --git a/mayan/apps/common/links.py b/mayan/apps/common/links.py index 78b3a5dcb6..5fbea67244 100644 --- a/mayan/apps/common/links.py +++ b/mayan/apps/common/links.py @@ -52,7 +52,6 @@ link_documentation = Link( link_object_error_list = Link( icon_class_path='mayan.apps.common.icons.icon_object_error_list', kwargs=get_kwargs_factory('resolved_object'), - icon_class_path='mayan.apps.common.icons.icon_object_error_list', permissions=(permission_error_log_view,), text=_('Errors'), view='common:object_error_list', ) diff --git a/mayan/apps/document_states/apps.py b/mayan/apps/document_states/apps.py index e3dc71ed91..8fc4e95cd5 100644 --- a/mayan/apps/document_states/apps.py +++ b/mayan/apps/document_states/apps.py @@ -410,12 +410,6 @@ class DocumentStatesApp(MayanAppConfig): WorkflowTransition, ) ) - menu_secondary.bind_links( - links=(link_setup_workflow_transition_field_create,), - sources=( - WorkflowTransition, - ) - ) menu_secondary.bind_links( links=(link_workflow_runtime_proxy_list,), sources=( diff --git a/mayan/apps/redactions/classes.py b/mayan/apps/redactions/classes.py deleted file mode 100644 index 4fd0e7e1de..0000000000 --- a/mayan/apps/redactions/classes.py +++ /dev/null @@ -1,28 +0,0 @@ -''' -from __future__ import unicode_literals - -import logging - -from PIL import Image - -from converter import converter_class - -logger = logging.getLogger(__name__) - - -class OCRBackendBase(object): - def execute(self, file_object, language=None, process_barcodes=True, process_text=True, transformations=None): - self.language = language - self.process_barcodes = process_barcodes - self.process_text = process_text - - if not transformations: - transformations = [] - - self.converter = converter_class(file_object=file_object) - - for transformation in transformations: - self.converter.transform(transformation=transformation) - - self.image = Image.open(self.converter.get_page()) -''' diff --git a/mayan/apps/redactions/exceptions.py b/mayan/apps/redactions/exceptions.py deleted file mode 100644 index a1da2698a9..0000000000 --- a/mayan/apps/redactions/exceptions.py +++ /dev/null @@ -1,16 +0,0 @@ -'''from __future__ import unicode_literals - - -class OCRError(Exception): - """ - Raised by the OCR backend - """ - pass - - -class UnpaperError(Exception): - """ - Raised by unpaper - """ - pass -''' diff --git a/mayan/apps/redactions/forms.py b/mayan/apps/redactions/forms.py deleted file mode 100644 index cd773fae29..0000000000 --- a/mayan/apps/redactions/forms.py +++ /dev/null @@ -1,15 +0,0 @@ -from __future__ import unicode_literals - -from django import forms -from django.utils.translation import ugettext_lazy as _ - -from .models import Redaction - - -class RedactionCoordinatesForm(forms.ModelForm): - class Meta: - fields = ('arguments',) - model = Redaction - widgets = { - 'arguments': forms.widgets.Textarea(attrs={'class': 'hidden'}), - } diff --git a/mayan/apps/redactions/links.py b/mayan/apps/redactions/links.py deleted file mode 100644 index 90eb51ec59..0000000000 --- a/mayan/apps/redactions/links.py +++ /dev/null @@ -1,32 +0,0 @@ -from __future__ import unicode_literals - -from django.utils.translation import ugettext_lazy as _ - -from mayan.apps.navigation.classes import Link - -from .permissions import ( - permission_redaction_create, permission_redaction_delete, - permission_redaction_edit, permission_redaction_view -) - -link_redaction_create = Link( - icon_class_path='mayan.apps.redactions.icons.icon_redaction_create', - permissions=(permission_redaction_create,), text=_('Create redaction'), - view='redactions:redaction_create', args='resolved_object.id' -) -link_redaction_delete = Link( - icon_class_path='mayan.apps.redactions.icons.icon_redaction_delete', - permissions=(permission_redaction_delete,), tags='dangerous', - text=_('Delete'), view='redactions:redaction_delete', - args='resolved_object.id' -) -link_redaction_edit = Link( - icon_class_path='mayan.apps.redactions.icons.icon_redaction_edit', - permissions=(permission_redaction_edit,), text=_('Edit'), - view='redactions:redaction_edit', args='resolved_object.id' -) -link_redaction_list = Link( - icon_class_path='mayan.apps.redactions.icons.icon_redactions', - permissions=(permission_redaction_view,), text=_('Redactions'), - view='redactions:redaction_list', args='resolved_object.id' -) diff --git a/mayan/apps/redactions/serializers.py b/mayan/apps/redactions/serializers.py deleted file mode 100644 index 9640050fb8..0000000000 --- a/mayan/apps/redactions/serializers.py +++ /dev/null @@ -1,5 +0,0 @@ -from rest_framework import serializers - - -class DocumentVersionOCRSerializer(serializers.Serializer): - document_version_id = serializers.IntegerField() diff --git a/mayan/apps/redactions/urls.py b/mayan/apps/redactions/urls.py deleted file mode 100644 index 4fb8f09e78..0000000000 --- a/mayan/apps/redactions/urls.py +++ /dev/null @@ -1,30 +0,0 @@ -from __future__ import unicode_literals - -from django.conf.urls import url - -from .views import ( - RedactionCreateView, RedactionDeleteView, RedactionEditView, - RedactionListView, -) - - -urlpatterns = [ - url( - regex=r'^document_pages/(?P\d+)/redactions/create/$', - view=RedactionCreateView.as_view(), name='redaction_create' - ), - url( - regex=r'^document_pages/(?P\d+)/redactions/$', - view=RedactionListView.as_view(), name='redaction_list' - ), - url( - regex=r'^redactions/(?P\d+)/delete/$', - view=RedactionDeleteView.as_view(), name='redaction_delete' - ), - url( - regex=r'^redactions/(?P\d+)/edit/$', - view=RedactionEditView.as_view(), name='redaction_edit' - ), -] - -api_urls = [] diff --git a/mayan/apps/redactions/views.py b/mayan/apps/redactions/views.py deleted file mode 100644 index 863d6ea2f7..0000000000 --- a/mayan/apps/redactions/views.py +++ /dev/null @@ -1,147 +0,0 @@ -from __future__ import absolute_import, unicode_literals - -import logging - -from django.core.urlresolvers import reverse -from django.template import RequestContext -from django.utils.translation import ugettext_lazy as _ - -from mayan.apps.common.generics import ( - SingleObjectCreateView, SingleObjectDeleteView, SingleObjectEditView, - SingleObjectListView -) -from mayan.apps.common.mixins import ExternalObjectMixin -from mayan.apps.converter.transformations import TransformationDrawRectanglePercent -from mayan.apps.documents.models import DocumentPage - -from .forms import RedactionCoordinatesForm -from .icons import icon_redactions -from .links import link_redaction_create -from .models import Redaction -from .permissions import ( - permission_redaction_create, permission_redaction_delete, - permission_redaction_edit, permission_redaction_view -) - -logger = logging.getLogger(__name__) - - -class RedactionCreateView(ExternalObjectMixin, SingleObjectCreateView): - external_object_class = DocumentPage - external_object_pk_url_kwarg = 'pk' - form_class = RedactionCoordinatesForm - model = Redaction - object_permission = permission_redaction_create - template_name = 'redactions/cropper.html' - - def form_valid(self, form): - instance = form.save(commit=False) - instance.content_object = self.external_object - instance.name = TransformationDrawRectanglePercent.name - instance.save() - return super(RedactionCreateView, self).form_valid(form) - - def get_extra_context(self, **kwargs): - context = { - 'document_page': self.external_object, - 'redaction': self.object, - 'title': _('Create redaction for: %s') % self.external_object - } - - return context - - def get_post_action_redirect(self): - return reverse( - viewname='redactions:redaction_list', kwargs={ - 'pk': self.external_object.pk - } - ) - - -class RedactionDeleteView(SingleObjectDeleteView): - model = Redaction - object_permission = permission_redaction_delete - - def get_post_action_redirect(self): - return reverse( - viewname='redactions:redaction_list', kwargs={ - 'pk': self.object.content_object.pk - } - ) - - def get_extra_context(self): - return { - 'content_object': self.object.content_object, - 'navigation_object_list': ('content_object', 'redaction'), - 'previous': reverse( - viewname='redactions:redaction_list', kwargs={ - 'pk': self.object.content_object.pk - } - ), - 'redaction': self.object, - 'title': _( - 'Delete refaction for: %(content_object)s?' - ) % { - 'content_object': self.object.content_object - }, - } - - -class RedactionEditView(SingleObjectEditView): - form_class = RedactionCoordinatesForm - model = Redaction - object_permission = permission_redaction_edit - template_name = 'redactions/cropper.html' - - def get_extra_context(self, **kwargs): - context = { - 'document_page': self.object.content_object, - 'navigation_object_list': ['document_page', 'redaction'], - 'redaction': self.object, - 'title': _('Edit redaction: %s') % self.object - } - - return context - - def get_post_action_redirect(self): - return reverse( - viewname='redactions:redaction_list', kwargs={ - 'pk': self.object.content_object.pk - } - ) - - -class RedactionListView(ExternalObjectMixin, SingleObjectListView): - external_object_class = DocumentPage - object_permission = permission_redaction_view - external_object_pk_url_kwarg = 'pk' - - def dispatch(self, request, *args, **kwargs): - return super(RedactionListView, self).dispatch( - request, *args, **kwargs - ) - - def get_extra_context(self): - return { - 'hide_object': True, - 'object': self.external_object, - 'no_results_icon': icon_redactions, - 'no_results_main_link': link_redaction_create.resolve( - context=RequestContext( - request=self.request, dict_={ - 'object': self.external_object - } - ) - ), - 'no_results_text': _( - 'Redactions allow removing access to confidential and ' - 'sensitive information without having to modify the document.' - ), - 'no_results_title': _('No existing redactions'), - 'title': _('Redactions for: %s') % self.external_object, - } - - def get_source_queryset(self): - return Redaction.objects.get_for_object( - obj=self.external_object - ).filter(name__startswith='draw') diff --git a/mayan/settings/base.py b/mayan/settings/base.py index 5072fb150a..a9c64bc847 100644 --- a/mayan/settings/base.py +++ b/mayan/settings/base.py @@ -123,7 +123,6 @@ INSTALLED_APPS = ( 'mayan.apps.mayan_statistics', 'mayan.apps.metadata', 'mayan.apps.mirroring', - 'mayan.apps.redactions', 'mayan.apps.ocr', 'mayan.apps.redactions', 'mayan.apps.sources', diff --git a/requirements/base.txt b/requirements/base.txt index e74cc93d45..87dd80811c 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,13 +1,10 @@ Pillow==6.0.0 PyPDF2==1.26.0 PyYAML==5.1.1 -celery==4.3.0 django-activity-stream==0.7.0 -django-celery-beat==1.5.0 django-colorful==1.3 django-cors-headers==2.5.2 django-downloadview==1.9 -django-environ==0.4.5 django-formtools==2.1 django-mathfilters==0.4.0 django-model-utils==3.1.2 diff --git a/setup.py b/setup.py index 67898584f0..a8ab7ec567 100644 --- a/setup.py +++ b/setup.py @@ -60,13 +60,10 @@ django==1.11.24 Pillow==6.0.0 PyPDF2==1.26.0 PyYAML==5.1.1 -celery==4.3.0 django-activity-stream==0.7.0 -django-celery-beat==1.5.0 django-colorful==1.3 django-cors-headers==2.5.2 django-downloadview==1.9 -django-environ==0.4.5 django-formtools==2.1 django-mathfilters==0.4.0 django-model-utils==3.1.2