Skip to content

Commit

Permalink
Merge pull request #5175 from onepercentclub/hotfix/team-filter
Browse files Browse the repository at this point in the history
Hotfix/team filter
  • Loading branch information
gannetson committed Aug 9, 2022
2 parents d72cc53 + 446c109 commit 7224e8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bluebottle/activities/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ def test_get_filtered_status(self):
resource['id'] in [str(team.pk) for team in new_teams]
)

def test_get_filtered_has_slot(self):
def test_get_filtered_has_no_slot(self):
self.perform_get(user=self.activity.owner, query={'filter[has_slot]': 'false'})

self.assertStatus(status.HTTP_200_OK)
Expand Down
4 changes: 3 additions & 1 deletion bluebottle/activities/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,9 @@ def get_queryset(self, *args, **kwargs):
if status:
queryset = queryset.filter(status=status)
elif has_slot == 'false':
queryset = queryset.filter(slot__start__isnull=True)
queryset = queryset.filter(slot__start__isnull=True).exclude(
status__in=['new', 'withdrawn', 'cancelled']
)
elif start == 'future':
queryset = queryset.filter(
slot__start__gt=timezone.now()
Expand Down

0 comments on commit 7224e8a

Please sign in to comment.