Backport support for global and object event notification. GitLab issue #262.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-08-01 01:18:07 -04:00
parent c4c0d4a007
commit f0baa16cde
38 changed files with 1274 additions and 159 deletions

View File

@@ -10,11 +10,17 @@ from django.utils.translation import ugettext_lazy as _
from acls import ModelPermission
from common import MayanAppConfig, menu_facet, menu_main, menu_sidebar
from common.classes import DashboardWidget
from common.dashboards import dashboard_main
from events import ModelEventType
from mayan.celery import app
from rest_api.classes import APIEndPoint
from .dashboard_widgets import widget_checkouts
from .events import (
event_document_auto_check_in, event_document_check_in,
event_document_check_out, event_document_forceful_check_in
)
from .handlers import check_new_version_creation
from .links import (
link_checkin_document, link_checkout_document, link_checkout_info,
@@ -72,6 +78,13 @@ class CheckoutsApp(MayanAppConfig):
)
)
ModelEventType.register(
model=Document, event_types=(
event_document_auto_check_in, event_document_check_in,
event_document_check_out, event_document_forceful_check_in
)
)
ModelPermission.register(
model=Document, permissions=(
permission_document_checkout,