Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Kaffe bonger #38

Merged
merged 18 commits into from
Jul 11, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Removed useless function call
  • Loading branch information
nicolaei committed Jul 6, 2016
commit 1284a83eab66c0095820aba44e796d9c1ffd82e6
10 changes: 5 additions & 5 deletions voucher/rest.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ class VoucherWalletViewSet(viewsets.ReadOnlyModelViewSet):
def get_queryset(self):
queryset = VoucherWallet.objects.all()
if self.action == 'stats':
return queryset.order_by()
return queryset
return queryset.prefetch_related('user', 'semester')

@list_route(methods=['get'])
@@ -76,7 +76,7 @@ class CoffeeWalletViewSet(viewsets.ReadOnlyModelViewSet):
def get_queryset(self):
queryset = CoffeeWallet.objects.all()
if self.action == 'stats':
return queryset.order_by()
return queryset
return queryset.prefetch_related('card', 'semester')

@list_route(methods=['get'])
@@ -231,9 +231,9 @@ def create(self, request, **kwargs):
comment=serializer.data['comment']
)

worklog.clean()
worklog.save()
return Response(VoucherRegisterLogSerializer(worklog, context={'request': self.request}).data,
registerlog.clean()
registerlog.save()
return Response(VoucherRegisterLogSerializer(registerlog, context={'request': self.request}).data,
status=status.HTTP_201_CREATED)