Пример #1
0
    def process_response(self, request, response):
        path = request.path
        if request.GET:
            get_params = request.GET.copy()
            if "noCache" in get_params:
                del get_params["noCache"]
            query_string = get_params.urlencode()
            if query_string:
                path = request.path + "?" + query_string
        response['X-Hue-JFrame-Path'] = iri_to_uri(path)
        if response.status_code == 200:
            if is_jframe_request(request):
                if hasattr(request, "flash"):
                    flashes = request.flash.get()
                    if flashes:
                        response['X-Hue-Flash-Messages'] = json.dumps(flashes)

        return response
Пример #2
0
  def process_response(self, request, response):
    path = request.path
    if request.GET:
      get_params = request.GET.copy()
      if "noCache" in get_params:
        del get_params["noCache"]
      query_string = get_params.urlencode()
      if query_string:
        path = request.path + "?" + query_string
    response['X-Hue-JFrame-Path'] = iri_to_uri(path)
    if response.status_code == 200:
      if is_jframe_request(request):
        if hasattr(request, "flash"):
          flashes = request.flash.get()
          if flashes:
            response['X-Hue-Flash-Messages'] = simplejson.dumps(flashes)

    return response