parameters: (self)
return_statement: return user
docstring: Raise 403 on API handlers instead of redirecting to human login page
docstring_summary: Raise 403 on API handlers instead of redirecting to human login page
docstring_tokens: Raise 403 on API handlers instead of redirecting to human login page
function: 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
function_tokens: 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