perf: 添加 temp token 排序

pull/8084/head
ibuler 3 years ago committed by Jiangjie.Bai
parent 7b2d51f343
commit f4ed4e1176

@ -15,7 +15,7 @@ class TempTokenViewSet(JMSModelViewSet):
def get_queryset(self): def get_queryset(self):
username = self.request.user.username username = self.request.user.username
return TempToken.objects.filter(username=username) return TempToken.objects.filter(username=username).order_by('-date_created')
@action(methods=['PATCH'], detail=True, url_path='expire') @action(methods=['PATCH'], detail=True, url_path='expire')
def expire(self, *args, **kwargs): def expire(self, *args, **kwargs):
@ -24,4 +24,3 @@ class TempTokenViewSet(JMSModelViewSet):
instance.save() instance.save()
serializer = self.get_serializer(instance) serializer = self.get_serializer(instance)
return Response(serializer.data) return Response(serializer.data)

Loading…
Cancel
Save