diff --git a/oarepo_requests/types/delete_draft.py b/oarepo_requests/types/delete_draft.py index b8166a5f..0f1c6f6b 100644 --- a/oarepo_requests/types/delete_draft.py +++ b/oarepo_requests/types/delete_draft.py @@ -26,7 +26,7 @@ def available_actions(cls): allowed_topic_ref_types = ModelRefTypes(published=False, draft=True) @override - def stateful_name(self, identity, *, topic=None, request=None): + def stateful_name(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return self.name if not request: @@ -38,7 +38,7 @@ def stateful_name(self, identity, *, topic=None, request=None): return _("Request draft deletion") @override - def stateful_description(self, identity, *, topic=None, request=None): + def stateful_description(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return _("Click to permanently delete the draft.") diff --git a/oarepo_requests/types/delete_published_record.py b/oarepo_requests/types/delete_published_record.py index c5ee6a60..69670b2a 100644 --- a/oarepo_requests/types/delete_published_record.py +++ b/oarepo_requests/types/delete_published_record.py @@ -29,7 +29,7 @@ def available_actions(cls): allowed_topic_ref_types = ModelRefTypes(published=True, draft=False) @override - def stateful_name(self, identity, *, topic=None, request=None): + def stateful_name(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return self.name if not request: @@ -41,7 +41,7 @@ def stateful_name(self, identity, *, topic=None, request=None): return _("Request record deletion") @override - def stateful_description(self, identity, *, topic=None, request=None): + def stateful_description(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return _("Click to permanently delete the record.") diff --git a/oarepo_requests/types/edit_record.py b/oarepo_requests/types/edit_record.py index 9bce216d..9ecbf3f9 100644 --- a/oarepo_requests/types/edit_record.py +++ b/oarepo_requests/types/edit_record.py @@ -58,7 +58,7 @@ def topic_change(self, request: Request, new_topic: Dict, uow): uow.register(RecordCommitOp(request, indexer=current_requests_service.indexer)) @override - def stateful_name(self, identity, *, topic=None, request=None): + def stateful_name(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return self.name if not request: @@ -70,7 +70,7 @@ def stateful_name(self, identity, *, topic=None, request=None): return _("Request edit access") @override - def stateful_description(self, identity, *, topic=None, request=None): + def stateful_description(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return _("Click to start editing the metadata of the record.") diff --git a/oarepo_requests/types/generic.py b/oarepo_requests/types/generic.py index 3b6f39cb..85e1bb9f 100644 --- a/oarepo_requests/types/generic.py +++ b/oarepo_requests/types/generic.py @@ -65,7 +65,7 @@ def available_actions(cls): "decline": OARepoDeclineAction, } - def stateful_name(self, identity, request): + def stateful_name(self, *, identity, topic, request=None, **kwargs): """ Returns the name of the request that reflects its current state. @@ -74,7 +74,7 @@ def stateful_name(self, identity, request): """ return self.name - def stateful_description(self, identity, request): + def stateful_description(self, *, identity, topic, request=None, **kwargs): """ Returns the description of the request that reflects its current state. diff --git a/oarepo_requests/types/new_version.py b/oarepo_requests/types/new_version.py index 14060656..8e0ebf74 100644 --- a/oarepo_requests/types/new_version.py +++ b/oarepo_requests/types/new_version.py @@ -58,7 +58,7 @@ def topic_change(self, request: Request, new_topic: Dict, uow): uow.register(RecordCommitOp(request, indexer=current_requests_service.indexer)) @override - def stateful_name(self, identity, *, topic=None, request=None): + def stateful_name(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return self.name if not request: @@ -70,7 +70,7 @@ def stateful_name(self, identity, *, topic=None, request=None): return _("Request new version access") @override - def stateful_description(self, identity, *, topic=None, request=None): + def stateful_description(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return _("Click to start creating a new version of the record.") diff --git a/oarepo_requests/types/publish_draft.py b/oarepo_requests/types/publish_draft.py index 3d97e3ed..9d067a1c 100644 --- a/oarepo_requests/types/publish_draft.py +++ b/oarepo_requests/types/publish_draft.py @@ -76,7 +76,7 @@ def topic_change(self, request: Request, new_topic: Dict, uow): uow.register(RecordCommitOp(request, indexer=current_requests_service.indexer)) @override - def stateful_name(self, identity, *, topic=None, request=None): + def stateful_name(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return _("Publish draft") if not request: @@ -88,7 +88,7 @@ def stateful_name(self, identity, *, topic=None, request=None): return _("Submit for review") @override - def stateful_description(self, identity, *, topic=None, request=None): + def stateful_description(self, identity, *, topic, request=None, **kwargs): if is_auto_approved(self, identity=identity, topic=topic): return _( "Click to immediately publish the draft. " diff --git a/setup.cfg b/setup.cfg index 9a61e447..5ae9bf95 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-requests -version = 2.2.0 +version = 2.2.1 description = authors = Ronald Krist readme = README.md