(self)
return user
Raise 403 on API handlers instead of redirecting to human login page
Raise 403 on API handlers instead of redirecting to human login page
Raise 403 on API handlers instead of redirecting to human login page
def get_current_user(self):
        """Raise 403 on API handlers instead of redirecting to human login page"""
        # preserve _user_cache so we don't raise more than once
        if hasattr(self, '_user_cache'):
            return self._user_cache
        self._user_cache = user = super().get_current_user()
        return user
def get_current_user ( self ) : # preserve _user_cache so we don't raise more than once if hasattr ( self , '_user_cache' ) : return self . _user_cache self . _user_cache = user = super ( ) . get_current_user ( ) return user