Merge 2 steps

This commit is contained in:
CasperVerswijvelt 2021-04-24 13:04:21 +02:00
parent 94c53d2ab5
commit 46176b19fc

View File

@ -132,10 +132,8 @@ class Service(models.Model):
service=self, start_time__lt=end_time, start_time__gt=start_time service=self, start_time__lt=end_time, start_time__gt=start_time
) )
hit_count = hits.count() hit_count = hits.count()
hits = Hit.objects.filter(
service=self has_hits = Hit.objects.filter(service=self).exists()
)
has_hits = hits.exists()
bounces = sessions.filter(is_bounce=True) bounces = sessions.filter(is_bounce=True)
bounce_count = bounces.count() bounce_count = bounces.count()