From 0607a56739008e80911d1d97ec4d8655dddd52d5 Mon Sep 17 00:00:00 2001 From: Kuroshini Date: Wed, 15 Jan 2020 16:46:53 +0300 Subject: [PATCH] Revert "possible fix for similar distilleries" This reverts commit 2197863 --- 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 24373793..c10be29d 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).exclude(same_subtype=False) + base_qs = self.similar_base(distillery).same_subtype(distillery) similarity_rules = { - 'distinctions': [], - 'ordering': [], + 'ordering': [F('same_subtype').desc(), ], + 'distinctions': ['same_subtype', ] } if distillery.address and distillery.address.coordinates: base_qs = base_qs.annotate_distance(point=distillery.location)