summaryrefslogtreecommitdiff
path: root/addons/auth_oauth/controllers/main.py
diff options
context:
space:
mode:
authorpso (OpenERP) <pso@tinyerp.com>2012-09-03 12:25:28 +0530
committerpso (OpenERP) <pso@tinyerp.com>2012-09-03 12:25:28 +0530
commitc8d240afbd5076e3e5b173d5c8d989ebee2e0791 (patch)
tree382cb5bb6ff0f22213d7083712164513a81db881 /addons/auth_oauth/controllers/main.py
parente07499a9a228a38a3206378e6617cd4022b12205 (diff)
parente3f1c26e6afcf7c3df9bd98166614778e27645ea (diff)
[MERGE] Merged with main branch
bzr revid: pso@tinyerp.com-20120903065528-b73t9t63t2iq20sw
Diffstat (limited to 'addons/auth_oauth/controllers/main.py')
-rw-r--r--addons/auth_oauth/controllers/main.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/auth_oauth/controllers/main.py b/addons/auth_oauth/controllers/main.py
index 2959fa45db1..5d939f19db1 100644
--- a/addons/auth_oauth/controllers/main.py
+++ b/addons/auth_oauth/controllers/main.py
@@ -7,6 +7,7 @@ import werkzeug.utils
import openerp.modules.registry
import openerp.addons.web.controllers.main
import openerp.addons.web.common.http as openerpweb
+from openerp import SUPERUSER_ID
_logger = logging.getLogger(__name__)
@@ -18,7 +19,7 @@ class OAuthController(openerpweb.Controller):
registry = openerp.modules.registry.RegistryManager.get(dbname)
with registry.cursor() as cr:
providers = registry.get('auth.oauth.provider')
- l = providers.read(cr, 1, providers.search(cr, 1, [('enabled','=',True)]))
+ l = providers.read(cr, SUPERUSER_ID, providers.search(cr, SUPERUSER_ID, [('enabled','=',True)]))
return l
@openerpweb.httprequest
@@ -30,7 +31,7 @@ class OAuthController(openerpweb.Controller):
with registry.cursor() as cr:
try:
u = registry.get('res.users')
- credentials = u.auth_oauth(cr, 1, provider, kw)
+ credentials = u.auth_oauth(cr, SUPERUSER_ID, provider, kw)
cr.commit()
return openerp.addons.web.controllers.main.login_and_redirect(req, *credentials)
except AttributeError: