def process_response(self, request, response):
     if isinstance(response, HttpResponseAjax):
         if (not response.contains_redirection()):
             messages = get_messages(request)
             if len(messages) > 0:
                 response.add_command(commands.notify(messages))
     return response
Esempio n. 2
0
 def process_response(self, request, response):
     if isinstance(response, HttpResponseAjax):
         if not response.contains_redirection():
             messages = get_messages(request)
             if len(messages) > 0:
                 response.add_command(commands.notify(messages))
     return response
def messages(request):
    '''
    Returns a lazy 'messages' context variable (JSON string).

    '''
    return {'messages': json.dumps(get_messages(request))}
def messages(request):
    """
    Returns a lazy 'messages' context variable (JSON string).
    """
    return {'messages': simplejson.dumps(get_messages(request))}
Esempio n. 5
0
def messages(request):
    '''
    Returns a lazy 'messages' context variable (JSON string).

    '''
    return {'messages': json.dumps(get_messages(request))}