Skip to content

Commit

Permalink
redirector: fixed communities redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandromumo committed Sep 25, 2023
1 parent cccf47c commit 2f9526b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions site/zenodo_rdm/redirector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 2f9526b

Please sign in to comment.