URL touristiccontent_category
can return types that are not properly associated with their respective category
#4487
Labels
The
api/v2/touristiccontent_category
endpoint returnsTouristicContentCategory
objects and for each of them, allTouristicContentType
objects that are associated with it in a touristic content that is published and has not been deleted:Geotrek-admin/geotrek/api/v2/serializers.py
Line 454 in 31f96d0
However, if a touristic content contains a category along with a type that is not associated with this category (even though this should not be possible, which is another topic), the endpoint will return the type as associated with the category.
Example (steps to reproduce):
api/v2/touristiccontent_category
-> both categories and their type options are correct:api/v2/touristiccontent_category
again -> the data for the second category should not appear in the response, as there is no valid pair (category, type) associated with a published touristic content for C2. Instead, the response still includes the second category which contains the type option from the first category:Actual | Expected :
The text was updated successfully, but these errors were encountered: