From 2f9526b7ed7253151c4c2ab1915fc3b25825bb38 Mon Sep 17 00:00:00 2001 From: alejandromumo Date: Mon, 25 Sep 2023 11:18:53 +0200 Subject: [PATCH] redirector: fixed communities redirect --- site/zenodo_rdm/redirector.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/site/zenodo_rdm/redirector.py b/site/zenodo_rdm/redirector.py index 2d65cd96c..f024ff198 100644 --- a/site/zenodo_rdm/redirector.py +++ b/site/zenodo_rdm/redirector.py @@ -54,7 +54,9 @@ def communities_detail_view_function(): :return: url for the view 'invenio_app_rdm_communities.communities_detail' :rtype: str """ - _id = request.view_args.get("id", request.view_args["community_id"]) + _id = request.view_args.get("id") + if not _id: + _id = request.view_args["community_id"] values = {"pid_value": _id} target = url_for("invenio_app_rdm_communities.communities_detail", **values) return target @@ -69,7 +71,9 @@ def communities_settings_view_function(): :return: url for the view 'invenio_communities.communities_settings' :rtype: str """ - _id = request.view_args.get("id", request.view_args["community_id"]) + _id = request.view_args.get("id") + if not _id: + _id = request.view_args["community_id"] values = {"pid_value": _id} target = url_for("invenio_communities.communities_settings", **values) return target