From 21978639bd8b63abc3b553606bc2f05dde1cdea7 Mon Sep 17 00:00:00 2001 From: Kuroshini Date: Wed, 15 Jan 2020 16:40:29 +0300 Subject: [PATCH] possible fix for similar distilleries --- apps/establishment/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/establishment/models.py b/apps/establishment/models.py index c10be29d..24373793 100644 --- a/apps/establishment/models.py +++ b/apps/establishment/models.py @@ -365,10 +365,10 @@ class EstablishmentQuerySet(models.QuerySet): Return QuerySet with objects that similar to Distillery. :param distillery: Establishment instance """ - base_qs = self.similar_base(distillery).same_subtype(distillery) + base_qs = self.similar_base(distillery).same_subtype(distillery).exclude(same_subtype=False) similarity_rules = { - 'ordering': [F('same_subtype').desc(), ], - 'distinctions': ['same_subtype', ] + 'distinctions': [], + 'ordering': [], } if distillery.address and distillery.address.coordinates: base_qs = base_qs.annotate_distance(point=distillery.location)