Skip to content

Commit

Permalink
Order feedback by activity start date (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksellen committed Aug 18, 2020
1 parent b691309 commit b1d3fd8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions karrot/activities/api.py
Expand Up @@ -29,7 +29,7 @@

class FeedbackPagination(CursorPagination):
page_size = 10
ordering = '-id'
ordering = '-activity_date'


class FeedbackViewSet(
Expand Down Expand Up @@ -65,7 +65,9 @@ def list(self, request, *args, **kwargs):
queryset = self.filter_queryset(self.get_queryset()) \
.select_related('about') \
.prefetch_related('about__activityparticipant_set', 'about__feedback_given_by') \
.annotate(timezone=F('about__place__group__timezone'))
.annotate(
timezone=F('about__place__group__timezone'),
activity_date=F('about__date__startswith'))
feedback = self.paginate_queryset(queryset)

activities = set()
Expand Down

0 comments on commit b1d3fd8

Please sign in to comment.