0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
This commit is contained in:
jacobtoppm 2020-02-13 11:28:05 +00:00 committed by Matt Westcott
parent 42de571d7a
commit 226942b3f1
8 changed files with 23 additions and 17 deletions

View File

@ -14,7 +14,7 @@ from taggit.managers import TaggableManager
from wagtail.admin import compare, widgets
from wagtail.core.fields import RichTextField
from wagtail.core.models import Page, GroupApprovalTask, Task, Workflow
from wagtail.core.models import GroupApprovalTask, Page, Task, Workflow
from wagtail.core.utils import camelcase_to_underscore, resolve_model_string
from wagtail.utils.decorators import cached_classmethod

View File

@ -1,7 +1,9 @@
from wagtail.admin.mail import GroupApprovalTaskStateSubmissionEmailNotifier, WorkflowStateApprovalEmailNotifier, WorkflowStateRejectionEmailNotifier, WorkflowStateSubmissionEmailNotifier
from wagtail.admin.mail import (
GroupApprovalTaskStateSubmissionEmailNotifier, WorkflowStateApprovalEmailNotifier,
WorkflowStateRejectionEmailNotifier, WorkflowStateSubmissionEmailNotifier)
from wagtail.core.models import TaskState, WorkflowState
from wagtail.core.signals import task_submitted, workflow_approved, workflow_rejected, workflow_submitted
from wagtail.core.signals import (
task_submitted, workflow_approved, workflow_rejected, workflow_submitted)
task_submission_email_notifier = GroupApprovalTaskStateSubmissionEmailNotifier()
workflow_submission_email_notifier = WorkflowStateSubmissionEmailNotifier()

View File

@ -9,7 +9,8 @@ from django.core.mail import EmailMultiAlternatives
from django.test import TestCase, override_settings
from django.urls import reverse
from wagtail.core.models import GroupApprovalTask, Page, Task, TaskState, Workflow, WorkflowPage, WorkflowTask, WorkflowState
from wagtail.core.models import (
GroupApprovalTask, Page, Task, TaskState, Workflow, WorkflowPage, WorkflowState, WorkflowTask)
from wagtail.core.signals import page_published
from wagtail.tests.testapp.models import SimplePage, SimpleTask
from wagtail.tests.utils import WagtailTestUtils

View File

@ -10,7 +10,8 @@ from django.template.response import TemplateResponse
from wagtail.admin.navigation import get_site_for_user
from wagtail.admin.site_summary import SiteSummaryPanel
from wagtail.core import hooks
from wagtail.core.models import Page, PageRevision, Task, TaskState, UserPagePermissionsProxy, WorkflowState
from wagtail.core.models import (
Page, PageRevision, Task, TaskState, UserPagePermissionsProxy, WorkflowState)
User = get_user_model()

View File

@ -30,7 +30,8 @@ from wagtail.admin.mail import send_notification
from wagtail.admin.navigation import get_explorable_root_page
from wagtail.core import hooks
from wagtail.core.exceptions import PageClassNotFoundError
from wagtail.core.models import Page, PageRevision, Task, TaskState, UserPagePermissionsProxy, WorkflowTask
from wagtail.core.models import (
Page, PageRevision, Task, TaskState, UserPagePermissionsProxy, WorkflowTask)
from wagtail.search.query import MATCH_ALL
from wagtail.search.utils import parse_query_string

View File

@ -2,12 +2,13 @@ from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator
from django.http import Http404
from django.utils.functional import cached_property
from django.utils.http import is_safe_url
from django.utils.translation import ugettext_lazy as _, ngettext
from django.views.decorators.http import require_POST
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse
from django.utils.functional import cached_property
from django.utils.http import is_safe_url
from django.utils.translation import ngettext
from django.utils.translation import ugettext_lazy as _
from django.views.decorators.http import require_POST
from wagtail.admin import messages
from wagtail.admin.edit_handlers import Workflow
@ -15,7 +16,7 @@ from wagtail.admin.forms.workflows import AddWorkflowToPageForm
from wagtail.admin.views.generic import CreateView, DeleteView, EditView, IndexView
from wagtail.admin.views.pages import get_valid_next_url_from_request
from wagtail.core.models import Page, Task, TaskState, WorkflowState
from wagtail.core.permissions import workflow_permission_policy, task_permission_policy
from wagtail.core.permissions import task_permission_policy, workflow_permission_policy
class Index(IndexView):

View File

@ -9,7 +9,7 @@ from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.cache import cache
from django.core.exceptions import ValidationError, PermissionDenied
from django.core.exceptions import PermissionDenied, ValidationError
from django.core.handlers.base import BaseHandler
from django.core.handlers.wsgi import WSGIRequest
from django.db import models, transaction
@ -33,7 +33,8 @@ from treebeard.mp_tree import MP_Node
from wagtail.core.query import PageQuerySet, TreeQuerySet
from wagtail.core.signals import (
page_published, page_unpublished, post_page_move, pre_page_move,
task_approved, task_cancelled, task_rejected, task_submitted, workflow_approved, workflow_cancelled, workflow_rejected, workflow_submitted)
task_approved, task_cancelled, task_rejected, task_submitted,
workflow_approved, workflow_cancelled, workflow_rejected, workflow_submitted)
from wagtail.core.sites import get_site_for_hostname
from wagtail.core.url_routing import RouteResult
from wagtail.core.utils import WAGTAIL_APPEND_SLASH, camelcase_to_underscore, resolve_model_string

View File

@ -1,16 +1,15 @@
import datetime
import pytz
import pytz
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
from django.db.utils import IntegrityError
from django.test import TestCase, override_settings
from freezegun import freeze_time
from wagtail.core.models import GroupApprovalTask, Page, Task, Workflow, WorkflowPage, WorkflowTask
from wagtail.tests.testapp.models import SimplePage
from freezegun import freeze_time
class TestWorkflows(TestCase):
fixtures = ['test.json']