diff --git a/oscarapi/utils/exists.py b/oscarapi/utils/exists.py index b81c7d31..cff90da4 100644 --- a/oscarapi/utils/exists.py +++ b/oscarapi/utils/exists.py @@ -57,9 +57,8 @@ def find_existing_attribute_option_group(name, options): AttributeOptionGroup.objects.filter(name=name) .annotate(options_count=models.Count("options")) .filter(options_count=len(options)) + .filter(options__option__in=option) ) - for option in options: - query = query.filter(options__option=option) try: return query.get()