Skip to content

Commit

Permalink
filter the notifications passed
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzaloprelatto committed Jul 30, 2020
1 parent eb26512 commit 0cf159c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from datetime import date
from django.shortcuts import get_object_or_404
from django.db import connection
from datetime import datetime

class userTypeViewSet(viewsets.ModelViewSet):
"""
Expand Down Expand Up @@ -79,7 +80,7 @@ def update(self, request, pk=None):
return Response({"code": 403, "message": "Not Authorized", "data" : []})

def list(self, request):
queryset = notification.objects.all()
queryset = notification.objects.filter(date_from__lte = date.today() , date_to__gte = date.today())
serializer = notificationSerializer(queryset, many=True)
return Response(serializer.data)

Expand Down

0 comments on commit 0cf159c

Please sign in to comment.