Move new version creation blocking from the documents app to the checkouts app.

Closes GitLab #294.
This commit is contained in:
Roberto Rosario
2016-12-22 01:45:43 -04:00
parent 71af09c1fc
commit 1e194e04fa
16 changed files with 181 additions and 99 deletions

View File

@@ -20,7 +20,7 @@ from .permissions import (
def document_new_version_not_blocked(context):
NewVersionBlock = apps.get_model(
app_label='documents', model_name='NewVersionBlock'
app_label='checkouts', model_name='NewVersionBlock'
)
return not NewVersionBlock.objects.is_blocked(context['object'])

View File

@@ -9,9 +9,10 @@ from django.test.client import Client
from django.test import TestCase, override_settings
from acls.models import AccessControlList
from checkouts.models import NewVersionBlock
from common.tests.test_views import GenericViewTestCase
from common.utils import fs_cleanup, mkdtemp
from documents.models import Document, DocumentType, NewVersionBlock
from documents.models import Document, DocumentType
from documents.permissions import permission_document_create
from documents.tests import (
TEST_DOCUMENT_PATH, TEST_SMALL_DOCUMENT_PATH, TEST_DOCUMENT_DESCRIPTION,

View File

@@ -7,6 +7,7 @@ from django.shortcuts import get_object_or_404
from django.utils.translation import ugettext_lazy as _
from acls.models import AccessControlList
from checkouts.models import NewVersionBlock
from common import menu_facet
from common.models import SharedUploadedFile
from common.utils import encapsulate
@@ -15,7 +16,7 @@ from common.views import (
SingleObjectEditView, SingleObjectListView
)
from common.widgets import two_state_template
from documents.models import DocumentType, Document, NewVersionBlock
from documents.models import DocumentType, Document
from documents.permissions import (
permission_document_create, permission_document_new_version
)