(self)
return response
Returns a HttpResponse object of JSON error data.
Returns a HttpResponse object of JSON error data.
Returns a HttpResponse object of JSON error data .
def error_response(self):
        """Returns a HttpResponse object of JSON error data."""
        if self.error is not None:
            content = json.dumps({
                "error":getattr(self.error, "error", "invalid_request"),
                "error_description":self.error.message})
        else:
            content = ({
                "error":"invalid_request",
                "error_description":"Invalid Request."})
        if self.callback is not None:
            content = "%s(%s);" % (self.callback, content)
        response = Authenticator.error_response(
            self,
            content=content,
            content_type='application/json')
        if self.callback is not None:
            response.status_code = 200
        return response
def error_response ( self ) : if self . error is not None : content = json . dumps ( { "error" : getattr ( self . error , "error" , "invalid_request" ) , "error_description" : self . error . message } ) else : content = ( { "error" : "invalid_request" , "error_description" : "Invalid Request." } ) if self . callback is not None : content = "%s(%s);" % ( self . callback , content ) response = Authenticator . error_response ( self , content = content , content_type = 'application/json' ) if self . callback is not None : response . status_code = 200 return response