diff --git a/openedx_tagging/core/tagging/models/base.py b/openedx_tagging/core/tagging/models/base.py index b23893f3..1f3afd98 100644 --- a/openedx_tagging/core/tagging/models/base.py +++ b/openedx_tagging/core/tagging/models/base.py @@ -457,6 +457,11 @@ def _get_filtered_tags_deep( if pk is not None: matching_ids.append(pk) qs = qs.filter(pk__in=matching_ids) + elif excluded_values: + raise NotImplementedError("Using excluded_values without search_term is not currently supported.") + # We could implement this in the future but I'd prefer to get rid of the "excluded_values" API altogether. + # It remains to be seen if it's useful to do that on the backend, or if we can do it better/simpler on the + # frontend. qs = qs.annotate(child_count=models.Count("children")) # Add the "depth" to each tag: