From b83efd4c3dc950f6213f835caf8863676196ea57 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 28 Sep 2016 13:32:28 +0200 Subject: [PATCH] [FIX] google_drive: user_is_admin Oversight of commit e80f1152 which causes a crash since the variable is not defined anymore. opw-689353 --- addons/google_drive/google_drive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_drive/google_drive.py b/addons/google_drive/google_drive.py index 3cd7da3612d..73700abbdf3 100644 --- a/addons/google_drive/google_drive.py +++ b/addons/google_drive/google_drive.py @@ -67,7 +67,7 @@ class config(osv.Model): req = urllib2.Request('https://accounts.google.com/o/oauth2/token', data, headers) content = urllib2.urlopen(req, timeout=TIMEOUT).read() except urllib2.HTTPError: - if user_is_admin: + if self.pool['res.users']._is_admin(cr, uid, [uid]): model, action_id = self.pool['ir.model.data'].get_object_reference(cr, uid, 'base_setup', 'action_general_configuration') msg = _("Something went wrong during the token generation. Please request again an authorization code .") raise openerp.exceptions.RedirectWarning(msg, action_id, _('Go to the configuration panel'))