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

bug: correct self link in sub-communities endpoint #1218

Open
carlinmack opened this issue Oct 2, 2024 · 0 comments
Open

bug: correct self link in sub-communities endpoint #1218

carlinmack opened this issue Oct 2, 2024 · 0 comments

Comments

@carlinmack
Copy link
Contributor

carlinmack commented Oct 2, 2024

In subcommunities/services/service.py we have:

self_link = LinksTemplate(
    # https://github.com/inveniosoftware/invenio-communities/issues/1218
    # pagination_links("{+api}/communities/{community_id}/subcommunities{?args*}"),
    pagination_links("{+api}/communities/{community_id}/subcommunities"),
    context={"community_id": id_},
)
subcommunities._links_tpl = self_link

because the self_link returned from searching is not the subcommunities endpoint. As such we (improperly) directly replace the private _links_tpl with our own — however we do not have access to the correct args meaning that the self link, which could be subcommunties?p=1&size=10 will always return subcommunities as we don't have access

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

No branches or pull requests

1 participant