Skip to content

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

@carlinmack

Description

@carlinmack

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions