mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Moves where the mail views live and puts the ordering on those
This commit is contained in:
parent
ce9f604d81
commit
049dc17902
@ -33,10 +33,6 @@ from packaging import version as packaging_version
|
|||||||
from paperless import version
|
from paperless import version
|
||||||
from paperless.db import GnuPG
|
from paperless.db import GnuPG
|
||||||
from paperless.views import StandardPagination
|
from paperless.views import StandardPagination
|
||||||
from paperless_mail.models import MailAccount
|
|
||||||
from paperless_mail.models import MailRule
|
|
||||||
from paperless_mail.serialisers import MailAccountSerializer
|
|
||||||
from paperless_mail.serialisers import MailRuleSerializer
|
|
||||||
from rest_framework import parsers
|
from rest_framework import parsers
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
from rest_framework.exceptions import NotFound
|
from rest_framework.exceptions import NotFound
|
||||||
@ -914,37 +910,3 @@ class AcknowledgeTasksView(GenericAPIView):
|
|||||||
return Response({"result": result})
|
return Response({"result": result})
|
||||||
except Exception:
|
except Exception:
|
||||||
return HttpResponseBadRequest()
|
return HttpResponseBadRequest()
|
||||||
|
|
||||||
|
|
||||||
class MailAccountViewSet(ModelViewSet):
|
|
||||||
model = MailAccount
|
|
||||||
|
|
||||||
queryset = MailAccount.objects.all().order_by("pk")
|
|
||||||
serializer_class = MailAccountSerializer
|
|
||||||
pagination_class = StandardPagination
|
|
||||||
permission_classes = (IsAuthenticated,)
|
|
||||||
|
|
||||||
# TODO: user-scoped
|
|
||||||
# def get_queryset(self):
|
|
||||||
# user = self.request.user
|
|
||||||
# return MailAccount.objects.filter(user=user)
|
|
||||||
|
|
||||||
# def perform_create(self, serializer):
|
|
||||||
# serializer.save(user=self.request.user)
|
|
||||||
|
|
||||||
|
|
||||||
class MailRuleViewSet(ModelViewSet):
|
|
||||||
model = MailRule
|
|
||||||
|
|
||||||
queryset = MailRule.objects.all().order_by("pk")
|
|
||||||
serializer_class = MailRuleSerializer
|
|
||||||
pagination_class = StandardPagination
|
|
||||||
permission_classes = (IsAuthenticated,)
|
|
||||||
|
|
||||||
# TODO: user-scoped
|
|
||||||
# def get_queryset(self):
|
|
||||||
# user = self.request.user
|
|
||||||
# return MailRule.objects.filter(user=user)
|
|
||||||
|
|
||||||
# def perform_create(self, serializer):
|
|
||||||
# serializer.save(user=self.request.user)
|
|
||||||
|
@ -10,7 +10,7 @@ from rest_framework.viewsets import ModelViewSet
|
|||||||
class MailAccountViewSet(ModelViewSet):
|
class MailAccountViewSet(ModelViewSet):
|
||||||
model = MailAccount
|
model = MailAccount
|
||||||
|
|
||||||
queryset = MailAccount.objects.all()
|
queryset = MailAccount.objects.all().order_by("pk")
|
||||||
serializer_class = MailAccountSerializer
|
serializer_class = MailAccountSerializer
|
||||||
pagination_class = StandardPagination
|
pagination_class = StandardPagination
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
@ -27,7 +27,7 @@ class MailAccountViewSet(ModelViewSet):
|
|||||||
class MailRuleViewSet(ModelViewSet):
|
class MailRuleViewSet(ModelViewSet):
|
||||||
model = MailRule
|
model = MailRule
|
||||||
|
|
||||||
queryset = MailRule.objects.all()
|
queryset = MailRule.objects.all().order_by("pk")
|
||||||
serializer_class = MailRuleSerializer
|
serializer_class = MailRuleSerializer
|
||||||
pagination_class = StandardPagination
|
pagination_class = StandardPagination
|
||||||
permission_classes = (IsAuthenticated,)
|
permission_classes = (IsAuthenticated,)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user