diff --git a/oscarapi/utils/exists.py b/oscarapi/utils/exists.py index 4e5f7db3..588ef575 100644 --- a/oscarapi/utils/exists.py +++ b/oscarapi/utils/exists.py @@ -56,8 +56,7 @@ def find_existing_attribute_option_group(name, options): query = ( AttributeOptionGroup.objects.filter(name=name) .annotate(options_count=models.Count("options")) - .filter(options_count=len(options)) - .filter(options__option__in=options) + .filter(options_count=len(options), options__option__in=options) ) try: