|
|
@ -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)
|
|
|
|
|
|
|
|
|
|
|
|