diff --git a/api/urls.py b/api/urls.py index 785d49f7..497e7d68 100644 --- a/api/urls.py +++ b/api/urls.py @@ -120,7 +120,8 @@ router.register_view(r'dns/reverse-zones', views.DNSReverseZonesView), router.register_view(r'mailing/standard', views.StandardMailingView), router.register_view(r'mailing/club', views.ClubMailingView), # PRINTER -router.register_viewset(r'printer/jobs', views.JobsView) +router.register_viewset(r'printer/printable-jobs', views.PrintableJobsView) +router.register_viewset(r'printer/history-jobs', views.HistoryJobsView) # TOKEN AUTHENTICATION router.register_view(r'token-auth', views.ObtainExpiringAuthToken) diff --git a/api/views.py b/api/views.py index f94d6eaf..7a68b896 100644 --- a/api/views.py +++ b/api/views.py @@ -673,12 +673,18 @@ class ClubMailingView(generics.ListAPIView): serializer_class = serializers.MailingSerializer # PRINTER -class JobsView(viewsets.ModelViewSet): +class PrintableJobsView(viewsets.ModelViewSet): """Api Root Jobs """ queryset = printer.JobWithOptions.objects.filter(status='Printable') serializer_class = serializers.PrintJobSerializer +class HistoryJobsView(viewsets.ModelViewSet): + """Api Root Jobs + """ + queryset = printer.JobWithOptions.objects.exclude(status='Printable').exclude(status='Pending') + serializer_class = serializers.PrintJobSerializer + # TOKEN AUTHENTICATION