On Thu, Feb 1, 2018 at 12:28 AM, Gautam Kumar <[email protected]>
wrote:

> user = None
> request = self.context.get("request")
>
>
If it is on CBV, the request is available on self.request


> if request and hasattr(request, "user"):
>     user = request.user
>
> in 2nd line i am getting none as request.please help me
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django REST framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to