django-contrib

request.user returns a SimpleLazyObject, how do I "wake" it?

request.user returns a SimpleLazyObject, how do I "wake" it? Question: I have the following method: def _attempt(actor): if actor.__class__ != User: raise TypeError Which is called from a view: self.object.attempt(self.request.user) As you can see, the _attempt method expects actor to be type django.contrib.auth.models.User, however the object appears to be of type django.utils.functional.SimpleLazyObject. Why is this …

Total answers: 7