Add metric 'helpers_registered'

pull/1/head
Luca 2 years ago
parent f2dbda15aa
commit aabbb372b5

@ -19,6 +19,25 @@ def metrics(request):
"helpers_confirmed_total",
Helper.objects.filter(number_validated=True).count(),
),
(
"helpers_registered",
Helper.objects.annotate(
shift_count=Count(
Case(
When(
shiftregistration__state__in=[
ShiftRegistration.RegState.REGISTERED,
ShiftRegistration.RegState.CHECKED_IN,
],
then=1,
),
output_field=models.IntegerField(),
)
)
)
.filter(number_validated=True, shift_count__gte=1)
.count(),
),
(
"helpers_helped_total",
Helper.objects.annotate(

Loading…
Cancel
Save