Skip to content

Commit

Permalink
Fix error on stats dash
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkcuys committed Aug 27, 2024
1 parent f005ae9 commit a992fef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions studygroups/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ def get_top_discourse_topics_and_users(limit=10):
def get_active_teams():
today = datetime.datetime.now()
two_weeks_ago = today - relativedelta(days=+14)
memberships = StudyGroup.objects.published().filter(Q(start_date__gte=today) | Q(start_date__lte=today, end_date__gte=today) | Q(end_date__gt=two_weeks_ago, end_date__lte=today)).values_list('facilitator__teammembership', flat=True)
active_teams = Team.objects.filter(teammembership__in=memberships).distinct()
team_ids = StudyGroup.objects.published().filter(Q(start_date__gte=today) | Q(start_date__lte=today, end_date__gte=today) | Q(end_date__gt=two_weeks_ago, end_date__lte=today)).values_list('team', flat=True)
active_teams = Team.objects.filter(id__in=team_ids).distinct()
return active_teams

def get_active_facilitators():
Expand Down

0 comments on commit a992fef

Please sign in to comment.