even more security

bzr revid: nicolas.vanhoren@openerp.com-20130613113458-2ww1cbb9q5nz6ayk
This commit is contained in:
niv-openerp
2013-06-13 13:34:58 +02:00
parent 085d34bec3
commit 2c959246b7
+2 -1
View File
@@ -45,7 +45,8 @@ class Model(object):
def proxy(*args, **kw):
# Can't provide any retro-compatibility for this case, so we check it and raise an Exception
# to tell the programmer to adapt his code
if self.session._db != http.request.db or self.session._uid != http.request.uid:
if not http.request.db or not http.request.uid or self.session._db != http.request.db \
or self.session._uid != http.request.uid:
raise Exception("Trying to use Model with badly configured database or user.")
mod = http.request.registry.get(self.model)