Commit b9a4d878 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch '496-remove-dups-in-stats' into 'master'

no longer count members twice in statistics

Closes #496

See merge request !554
parents c34eba88 0bfc5643
......@@ -441,6 +441,7 @@ def gen_stats_member_type(member_types):
total[member_type] = (Member
.active_members
.filter(user__membership__type=member_type)
.distinct()
.count())
return total
......@@ -461,6 +462,7 @@ def gen_stats_year(member_types):
.active_members
.filter(starting_year=current_year - i)
.filter(user__membership__type=member_type)
.distinct()
.count())
stats_year.append(new)
......@@ -471,6 +473,7 @@ def gen_stats_year(member_types):
.active_members
.filter(starting_year__lt=current_year - 4)
.filter(user__membership__type=member_type)
.distinct()
.count())
stats_year.append(new)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment