Coverage for events/managers.py: 31%
10 statements
« prev ^ index » next coverage.py v6.4.4, created at 2022-10-27 10:35 -0500
« prev ^ index » next coverage.py v6.4.4, created at 2022-10-27 10:35 -0500
1from django.db.models import Manager
4class StationCheckInManager(Manager):
5 """
6 Manager for Station Checkins
7 """
9 def completed(self, challenge, team_slug=None, pending_approval=False):
10 check_ins = self.filter(
11 station__challenge=challenge, has_checkin=True
12 )
13 if team_slug:
14 check_ins = check_ins.filter(team__random_slug=team_slug)
15 if pending_approval:
16 check_ins = check_ins.filter(is_approved=False)
17 check_ins = check_ins.order_by('-checkin_timestamp')
18 return check_ins