From 68f6f1995fcd5d0c5f334aee0f84b1d3d1192b16 Mon Sep 17 00:00:00 2001 From: Braden MacDonald Date: Wed, 25 Oct 2023 12:54:09 -0700 Subject: [PATCH] fix: warn if excluded_values will be ignored --- openedx_tagging/core/tagging/models/base.py | 5 +++++ 1 file changed, 5 insertions(+) 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: