GrafeasGroup / blossom

The website. The app. The everything.
6 stars 3 forks source link

Add `active_volunteer_count` to `summary` endpoint #198

Closed TimJentzsch closed 3 years ago

TimJentzsch commented 3 years ago

Add the number of active volunteers to the summary endpoint. A volunteer counts as active if they completed a submission/made a transcription in the last 2 weeks (or another short time frame). This would give us the opportunity to see how many volunteers are actually still transcribing and whether we are gaining or losing active volunteers.

This can be archived by a query like the following (not tested):

active_volunteer_count = Submission.objects.filter(
    completed_by__isnull=False,
    complete_time__gt=date_minus_two_weeks,
).values("completed_by").count()

So we filter the submissions by those that have been completed within the last two weeks, then group it by the volunteers who completed it (so that we have a volunteer count, not a submission count) and then count how many we have.