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

@@ -6,6 +6,7 @@ from kombu import Exchange, Queue
from django.apps import apps
from django.core.urlresolvers import reverse_lazy
from django.db.models.signals import pre_save
from django.utils.translation import ugettext_lazy as _
from acls import ModelPermission
@@ -14,6 +15,7 @@ from common.classes import DashboardWidget
from mayan.celery import app
from rest_api.classes import APIEndPoint
from .handlers import check_new_version_creation
from .links import (
link_checkin_document, link_checkout_document, link_checkout_info,
link_checkout_list
@@ -40,6 +42,9 @@ class CheckoutsApp(MayanAppConfig):
Document = apps.get_model(
app_label='documents', model_name='Document'
)
DocumentVersion = apps.get_model(
app_label='documents', model_name='DocumentVersion'
)
DocumentCheckout = self.get_model('DocumentCheckout')
@@ -117,3 +122,9 @@ class CheckoutsApp(MayanAppConfig):
'checkouts:checkin_document'
)
)
pre_save.connect(
check_new_version_creation,
dispatch_uid='check_new_version_creation',
sender=DocumentVersion
)