[IMP] move dispatch()'s post processing code into a method

bzr revid: fme@openerp.com-20140124103546-h8an7dehqdc412cn
This commit is contained in:
Fabien Meghazi
2014-01-24 11:35:46 +01:00
parent 3cad7c9812
commit 2b6ac77f11
+11 -8
View File
@@ -104,14 +104,7 @@ class ir_http(osv.AbstractModel):
convert_exception_to(
werkzeug.exceptions.Forbidden))
# post process arg to set uid on browse records
for arg in arguments.itervalues():
if isinstance(arg, orm.browse_record) and arg._uid is UID_PLACEHOLDER:
arg._uid = request.uid
try:
arg[arg._rec_name]
except KeyError:
return self._handle_exception(werkzeug.exceptions.NotFound())
self._postprocess_args(arguments)
# set and execute handler
try:
@@ -124,6 +117,16 @@ class ir_http(osv.AbstractModel):
return result
def _postprocess_args(self, arguments):
""" post process arg to set uid on browse records """
for arg in arguments.itervalues():
if isinstance(arg, orm.browse_record) and arg._uid is UID_PLACEHOLDER:
arg._uid = request.uid
try:
arg[arg._rec_name]
except KeyError:
return self._handle_exception(werkzeug.exceptions.NotFound())
def routing_map(self):
if not hasattr(self, '_routing_map'):
_logger.info("Generating routing map")