look in the right place, fixes #2989

This commit is contained in:
j 2017-01-20 17:44:31 +01:00
parent f1f541fc0b
commit f71240ac2c

View file

@ -142,7 +142,8 @@ def buildCondition(k, op, v, user, exclude=False, owner=None):
k = str(k) k = str(k)
value_key = str(value_key) value_key = str(value_key)
if k == '*': if k == '*':
q = Q(**{value_key: v}) q = Q(**{'find__value' + get_operator(op): v}) | \
Q(**{'facets__value' + get_operator(op, 'istr'): v})
elif in_find: elif in_find:
q = Q(**{'find__key': k, value_key: v}) q = Q(**{'find__key': k, value_key: v})
else: else:
@ -257,6 +258,7 @@ class DocumentManager(Manager):
user, item) user, item)
if conditions: if conditions:
qs = qs.filter(conditions) qs = qs.filter(conditions)
qs = qs.distinct()
#anonymous can only see public items #anonymous can only see public items
if not user or user.is_anonymous(): if not user or user.is_anonymous():