From 99c2845355c90af6153299565ad22c91df4e7e4a Mon Sep 17 00:00:00 2001 From: Oguz Coluck Date: Fri, 16 Dec 2022 17:04:49 +0300 Subject: [PATCH 1/4] Convert ugettext_lazy to gettext_lazy --- river/models/base_model.py | 5 ++++- river/models/function.py | 5 ++++- river/models/hook.py | 5 ++++- river/models/on_approved_hook.py | 5 ++++- river/models/on_transit_hook.py | 5 ++++- river/models/state.py | 5 ++++- river/models/transition.py | 5 ++++- river/models/transitionapproval.py | 5 ++++- river/models/transitionapprovalmeta.py | 6 ++++-- river/models/transitionmeta.py | 5 ++++- river/models/workflow.py | 5 ++++- 11 files changed, 44 insertions(+), 12 deletions(-) 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 From 92eb09a3ee975e2c7dbd349037e35d7ed880f4a2 Mon Sep 17 00:00:00 2001 From: Oguz Coluck Date: Fri, 16 Dec 2022 17:17:06 +0300 Subject: [PATCH 2/4] Upgrade django-mptt package from 0.9.1 to 0.14 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 391151c..5c1b543 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -django-mptt==0.9.1 +django-mptt==0.14.0 factory-boy==2.11.1 mock==2.0.0 pyhamcrest==1.9.0 From f87f77fea3a71d47ffa7f638a1f8b1ba823420a4 Mon Sep 17 00:00:00 2001 From: Oguz Coluck Date: Fri, 16 Dec 2022 17:23:24 +0300 Subject: [PATCH 3/4] Remove providing_args argument from django.dispatch.dispatcher.Signal objects --- river/signals.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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__) From fe50916bf415fcb2a89b96086aa41525de8ba0eb Mon Sep 17 00:00:00 2001 From: Oguz Coluck Date: Sat, 17 Dec 2022 12:43:51 +0300 Subject: [PATCH 4/4] Upgrade django-cte version from 1.1.4 to 1.9.0 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5c1b543..c85898b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,6 +2,6 @@ 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