diff --git a/mayan/apps/acls/tests/test_views.py b/mayan/apps/acls/tests/test_views.py index 8fe4ab97ce..ddc450f5df 100644 --- a/mayan/apps/acls/tests/test_views.py +++ b/mayan/apps/acls/tests/test_views.py @@ -2,7 +2,6 @@ from __future__ import absolute_import, unicode_literals from django.contrib.contenttypes.models import ContentType -from documents.permissions import permission_document_view from documents.tests.test_views import GenericDocumentViewTestCase from user_management.tests import ( TEST_USER_USERNAME, TEST_USER_PASSWORD diff --git a/mayan/apps/acls/views.py b/mayan/apps/acls/views.py index edec9aa0e2..1d827fbd81 100644 --- a/mayan/apps/acls/views.py +++ b/mayan/apps/acls/views.py @@ -3,7 +3,6 @@ from __future__ import absolute_import, unicode_literals import itertools import logging -from django.contrib import messages from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse diff --git a/mayan/apps/common/generics.py b/mayan/apps/common/generics.py index a79aea823c..fadef63bf1 100644 --- a/mayan/apps/common/generics.py +++ b/mayan/apps/common/generics.py @@ -282,7 +282,7 @@ class SingleObjectCreateView(ObjectNameMixin, ViewPermissionCheckMixin, ExtraCon messages.error( self.request, _('%(object)s not created, error: %(error)s') % { - 'object': self.get_object_name(), + 'object': self.get_object_name(context=context), 'error': exception } ) @@ -293,7 +293,7 @@ class SingleObjectCreateView(ObjectNameMixin, ViewPermissionCheckMixin, ExtraCon self.request, _( '%(object)s created successfully.' - ) % {'object': self.get_object_name()} + ) % {'object': self.get_object_name(context=context)} ) return HttpResponseRedirect(self.get_success_url()) diff --git a/mayan/apps/document_indexing/apps.py b/mayan/apps/document_indexing/apps.py index 97b176a16b..3e0bf296ea 100644 --- a/mayan/apps/document_indexing/apps.py +++ b/mayan/apps/document_indexing/apps.py @@ -35,8 +35,7 @@ from .links import ( ) from .permissions import ( permission_document_indexing_create, permission_document_indexing_delete, - permission_document_indexing_edit, permission_document_indexing_view, - permission_document_indexing_rebuild + permission_document_indexing_edit, permission_document_indexing_view ) from .widgets import get_instance_link, index_instance_item_link, node_level diff --git a/mayan/apps/document_indexing/links.py b/mayan/apps/document_indexing/links.py index 2fc8b50622..2bf89f7dbc 100644 --- a/mayan/apps/document_indexing/links.py +++ b/mayan/apps/document_indexing/links.py @@ -2,13 +2,11 @@ from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ -from documents.permissions import permission_document_view from navigation import Link from .permissions import ( permission_document_indexing_create, permission_document_indexing_edit, permission_document_indexing_delete, permission_document_indexing_rebuild, - permission_document_indexing_view ) diff --git a/mayan/apps/document_indexing/tests/test_views.py b/mayan/apps/document_indexing/tests/test_views.py index 576f2f73db..3f3d98689a 100644 --- a/mayan/apps/document_indexing/tests/test_views.py +++ b/mayan/apps/document_indexing/tests/test_views.py @@ -1,6 +1,5 @@ from __future__ import absolute_import, unicode_literals -from documents.permissions import permission_document_view from documents.tests.test_views import GenericDocumentViewTestCase from user_management.tests import ( TEST_USER_USERNAME, TEST_USER_PASSWORD @@ -9,7 +8,7 @@ from user_management.tests import ( from ..models import Index from ..permissions import ( permission_document_indexing_create, permission_document_indexing_delete, - permission_document_indexing_edit, permission_document_indexing_view + permission_document_indexing_edit ) TEST_INDEX_LABEL = 'test label' diff --git a/mayan/apps/document_indexing/views.py b/mayan/apps/document_indexing/views.py index b510a81fa8..97c3d0a76f 100644 --- a/mayan/apps/document_indexing/views.py +++ b/mayan/apps/document_indexing/views.py @@ -3,9 +3,7 @@ from __future__ import absolute_import, unicode_literals from django.contrib import messages from django.core.exceptions import PermissionDenied from django.core.urlresolvers import reverse, reverse_lazy -from django.http import HttpResponseRedirect -from django.shortcuts import get_object_or_404, render_to_response -from django.template import RequestContext +from django.shortcuts import get_object_or_404 from django.utils.html import mark_safe from django.utils.translation import ugettext_lazy as _ @@ -147,6 +145,7 @@ class SetupIndexTreeTemplateListView(SingleObjectListView): 'title': _('Tree template nodes for index: %s') % self.get_index(), } + class TemplateNodeCreateView(SingleObjectCreateView): form_class = IndexTemplateNodeForm model = IndexTemplateNode diff --git a/mayan/apps/document_indexing/widgets.py b/mayan/apps/document_indexing/widgets.py index 70d9fdd16a..24a44680ee 100644 --- a/mayan/apps/document_indexing/widgets.py +++ b/mayan/apps/document_indexing/widgets.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals from django.apps import apps from django.utils.html import mark_safe, escape -from django.utils.translation import ugettext def get_instance_link(index_instance_node):