Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global: enabled sort by verified #535

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

alejandromumo
Copy link
Member

No description provided.

@alejandromumo alejandromumo force-pushed the enable_sort_by_verified branch from 594d360 to cccf47c Compare September 25, 2023 09:04
@@ -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")
Copy link
Member Author

@alejandromumo alejandromumo Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default value was analysed when it wasn't needed. This was throwing an exception when community_id was not in view_args

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we know in which cases we end up with missing community_id while the code expected it? Does it make sense to identify why it happens?

Copy link
Member Author

@alejandromumo alejandromumo Sep 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, by having a closer look I found out that community_id was never a view argument for any of the redirected routes (the pydoc was misleading).

The redirected routes that hit this view are the following:

    "redirect_communities_about_legacy": {
        "source": "/communities/about/<id>/",
        "target": communities_detail_view_function,
    },
    "redirect_collections_about": {
        "source": "/collection/user-<id>",
        "target": communities_detail_view_function,
    },

which means that id is the only view argument.

I also updated the pydoc of the method for clarity

@alejandromumo alejandromumo force-pushed the enable_sort_by_verified branch from 2f9526b to efbb27e Compare September 26, 2023 11:40
invenio.cfg Outdated Show resolved Hide resolved
@alejandromumo alejandromumo force-pushed the enable_sort_by_verified branch from 2cbd457 to a7a5b18 Compare September 26, 2023 12:00
@alejandromumo alejandromumo force-pushed the enable_sort_by_verified branch from a7a5b18 to 7c0277b Compare September 26, 2023 12:09
@kpsherva kpsherva merged commit 550e965 into zenodo:master Sep 27, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants