578 return temporary session token in user endpoint

closes #578 and #579
Sweet, thanks @ukanga
On Nov 24, 2014 11:31 AM, "ukanga" <notifications@github.com> wrote:

> In onadata/apps/api/viewsets/connect_viewset.py:
>
> > @@ -154,3 +177,12 @@ def reset(self, request, *args, **kwargs):
> >              return Response(status=status.HTTP_204_NO_CONTENT)
> >
> >          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
> > +
> > +    @list_route(methods=['DELETE'])
> > +    def expire(self, request, *args, **kwargs):
> > +        try:
> > +            TempToken.objects.get(user=request.user).delete()
> > +        except TempToken.DoesNotExist:
> > +            raise ParseError(_(u"Temporary token not found!"))
>
> @pld <https://github.com/pld> this will actually return the status code
> 400 with the message
>
> {"detail": "Temporary token not found!"}
>
> Raising the exception at this point is valid in rest_framework land.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/onaio/onadata/pull/710/files#r20801350>.
>