diff --git a/requirements.txt b/requirements.txt index 391151c..c85898b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -django-mptt==0.9.1 +django-mptt==0.14.0 factory-boy==2.11.1 mock==2.0.0 pyhamcrest==1.9.0 -django-cte==1.1.4 +django-cte==1.2.1 django-codemirror2==0.2 behave-django==1.3.0 \ No newline at end of file diff --git a/river/models/base_model.py b/river/models/base_model.py index c34f46b..f3b10c3 100644 --- a/river/models/base_model.py +++ b/river/models/base_model.py @@ -1,7 +1,10 @@ from django.conf import settings from django.db import models -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models.managers.rivermanager import RiverManager diff --git a/river/models/function.py b/river/models/function.py index 490e84e..0c3e3da 100644 --- a/river/models/function.py +++ b/river/models/function.py @@ -3,7 +3,10 @@ from django.db import models from django.db.models.signals import pre_save -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models import BaseModel diff --git a/river/models/hook.py b/river/models/hook.py index e4d3984..e03da60 100644 --- a/river/models/hook.py +++ b/river/models/hook.py @@ -3,7 +3,10 @@ from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import PROTECT -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models import Workflow, GenericForeignKey, BaseModel from river.models.function import Function diff --git a/river/models/on_approved_hook.py b/river/models/on_approved_hook.py index cf15d68..967da39 100644 --- a/river/models/on_approved_hook.py +++ b/river/models/on_approved_hook.py @@ -1,6 +1,9 @@ from django.db import models from django.db.models import CASCADE -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models import TransitionApprovalMeta, TransitionApproval from river.models.hook import Hook diff --git a/river/models/on_transit_hook.py b/river/models/on_transit_hook.py index e6c019e..2114bb3 100644 --- a/river/models/on_transit_hook.py +++ b/river/models/on_transit_hook.py @@ -1,6 +1,9 @@ from django.db import models from django.db.models import CASCADE -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models import TransitionMeta, Transition from river.models.hook import Hook diff --git a/river/models/state.py b/river/models/state.py index 12ade30..a606ea0 100644 --- a/river/models/state.py +++ b/river/models/state.py @@ -9,7 +9,10 @@ except ImportError: from six import python_2_unicode_compatible -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models.base_model import BaseModel from river.models.managers.state import StateManager diff --git a/river/models/transition.py b/river/models/transition.py index b295273..5d411a7 100644 --- a/river/models/transition.py +++ b/river/models/transition.py @@ -10,7 +10,10 @@ from django.contrib.contenttypes.generic import GenericForeignKey from django.db import models -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models.base_model import BaseModel from river.models.managers.transitionapproval import TransitionApprovalManager diff --git a/river/models/transitionapproval.py b/river/models/transitionapproval.py index 92964d3..da789ce 100644 --- a/river/models/transitionapproval.py +++ b/river/models/transitionapproval.py @@ -12,7 +12,10 @@ from django.contrib.contenttypes.generic import GenericForeignKey from django.db import models -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models.base_model import BaseModel from river.models.managers.transitionapproval import TransitionApprovalManager diff --git a/river/models/transitionapprovalmeta.py b/river/models/transitionapprovalmeta.py index b1c2f74..f965cf0 100644 --- a/river/models/transitionapprovalmeta.py +++ b/river/models/transitionapprovalmeta.py @@ -3,8 +3,10 @@ from django.db import models, transaction from django.db.models import PROTECT from django.db.models.signals import post_save, pre_delete -from django.utils.translation import ugettext_lazy as _ - +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.config import app_config from river.models import Workflow from river.models.base_model import BaseModel diff --git a/river/models/transitionmeta.py b/river/models/transitionmeta.py index 224bdf9..c48da90 100644 --- a/river/models/transitionmeta.py +++ b/river/models/transitionmeta.py @@ -2,7 +2,10 @@ from django.db import models from django.db.models import PROTECT -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.models import State, Workflow from river.models.base_model import BaseModel diff --git a/river/models/workflow.py b/river/models/workflow.py index aee0901..336ac62 100644 --- a/river/models/workflow.py +++ b/river/models/workflow.py @@ -1,6 +1,9 @@ from django.db import models from django.db.models import PROTECT -from django.utils.translation import ugettext_lazy as _ +try: + from django.utils.translation import ugettext_lazy as _ +except ImportError: + from django.utils.translation import gettext_lazy as _ from river.config import app_config from river.models import BaseModel, State diff --git a/river/signals.py b/river/signals.py index bc1ff44..9dbcf30 100644 --- a/river/signals.py +++ b/river/signals.py @@ -10,14 +10,14 @@ from river.models.on_complete_hook import OnCompleteHook from river.models.on_transit_hook import OnTransitHook -pre_on_complete = Signal(providing_args=["workflow_object", "field_name", ]) -post_on_complete = Signal(providing_args=["workflow_object", "field_name", ]) +pre_on_complete = Signal() +post_on_complete = Signal() -pre_transition = Signal(providing_args=["workflow_object", "field_name", "source_state", "destination_state"]) -post_transition = Signal(providing_args=["workflow_object", "field_name", "source_state", "destination_state"]) +pre_transition = Signal() +post_transition = Signal() -pre_approve = Signal(providing_args=["workflow_object", "field_name", "transition_approval"]) -post_approve = Signal(providing_args=["workflow_object", "field_name", "transition_approval", "transition_approval_meta"]) +pre_approve = Signal() +post_approve = Signal() LOGGER = logging.getLogger(__name__)