From 3b80050929408131c65234d5740e8247a6959990 Mon Sep 17 00:00:00 2001 From: Mirek Simek Date: Sun, 29 Sep 2024 20:19:30 +0200 Subject: [PATCH] Fixed exception in links when topic is no longer active --- oarepo_requests/actions/publish_draft.py | 5 ++++- setup.cfg | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/oarepo_requests/actions/publish_draft.py b/oarepo_requests/actions/publish_draft.py index c7a6c125..ecc8ca70 100644 --- a/oarepo_requests/actions/publish_draft.py +++ b/oarepo_requests/actions/publish_draft.py @@ -15,7 +15,10 @@ class PublishDraftSubmitAction(OARepoSubmitAction): def can_execute(self): if not super().can_execute(): return False - topic = self.request.topic.resolve() + try: + topic = self.request.topic.resolve() + except: # noqa: used for links, so ignore errors here + return False topic_service = get_record_service_for_record(topic) try: topic_service.validate_draft(system_identity, topic["id"]) diff --git a/setup.cfg b/setup.cfg index 51a60fcf..757f9236 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = oarepo-requests -version = 2.1.4 +version = 2.1.5 description = authors = Ronald Krist readme = README.md