python3: reduce needs proper six import (#32449)

This commit is contained in:
Paul Marillonnet 2019-04-10 15:13:18 +02:00
parent ac65fa8c4f
commit f63bd36159
1 changed files with 2 additions and 1 deletions

View File

@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from django.db import models
from django.utils import six
from django.utils import timezone
from django.contrib.auth.models import BaseUserManager
@ -44,7 +45,7 @@ class UserQuerySet(models.QuerySet):
q = q | models.query.Q(
attribute_values__content__icontains=term, attribute_values__attribute=a)
queries.append(q)
self = self.filter(reduce(models.query.Q.__and__, queries))
self = self.filter(six.moves.reduce(models.query.Q.__and__, queries))
# search by attributes can match multiple times
if searchable_attributes:
self = self.distinct()