Skip to content

Fix issue in co_components_ids() and cog_primary_co_sibling_ids() #7112

@CarolineDenis

Description

@CarolineDenis

See #6721 (comment)

Currently, if there is more than one CollectionObject with the same catalogNumber in the collection, the CollectionObject that gets selected by this statement is undefined.

This could result in returning the wrong set of component ids, possibly including or omitting incorrect Components in the Query.

The same applies for cog_primary_co_sibling_ids when the COG inheritance setting is enabled

def cog_primary_co_sibling_ids(cat_num, collection):
# Get the collection object with the given catalog number
co = Collectionobject.objects.filter(catalognumber=cat_num, collection=collection).first()

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