Parcourir la source

fix duplication de services dû à une annotation

Élie Bouttier il y a 7 ans
Parent
commit
b1738f4d7b
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      services/models.py

+ 1 - 1
services/models.py

@@ -83,7 +83,7 @@ class ActiveServiceManager(models.Manager):
                         output_field=models.BooleanField()
                     )
         )
-        qs = qs.order_by('pk', '-has_active_allocations').distinct() # complicated things here, do not touch if you're not sure
+        qs = qs.order_by('pk', '-has_active_allocations').distinct('pk') # complicated things here, do not touch if you're not sure
         return qs