From cc49b884870152edf99d319029a36ca20dcb3870 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 4 Dec 2013 15:56:13 +0100 Subject: [PATCH] [ADD] status_code to LazyResponse constructor bzr revid: fme@openerp.com-20131204145613-721x3ij2ylpykzgw --- openerp/http.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openerp/http.py b/openerp/http.py index 12ca2e28f84..dce6992c5dc 100644 --- a/openerp/http.py +++ b/openerp/http.py @@ -798,8 +798,10 @@ class LazyResponse(werkzeug.wrappers.Response): """ Lazy werkzeug response. API not yet frozen""" - def __init__(self, callback, **kwargs): + def __init__(self, callback, status_code=None, **kwargs): super(LazyResponse, self).__init__(mimetype='text/html') + if status_code: + self.status_code = status_code self.callback = callback self.params = kwargs def process(self):