From e1c55b2d2d3fc2ea61160b5305c7219e810553be Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Tue, 26 Jul 2016 10:15:26 +0200 Subject: [PATCH] [FIX] calendar: avoid local variable referenced before assignment When the get_one_event_synchro crash, the status variable is not initialize. So the return status, content, ... raise an error: "local variable 'status' referenced before assignment" This commit closes the issue #11513 --- addons/google_calendar/google_calendar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/google_calendar/google_calendar.py b/addons/google_calendar/google_calendar.py index 83aa9e583ea..995490c3cca 100644 --- a/addons/google_calendar/google_calendar.py +++ b/addons/google_calendar/google_calendar.py @@ -361,9 +361,10 @@ class google_calendar(osv.AbstractModel): url = "/calendar/v3/calendars/%s/events/%s" % ('primary', google_id) try: status, content, ask_time = self.pool['google.service']._do_request(cr, uid, url, params, headers, type='GET', context=context) - except: + except Exception, e: _logger.info("Calendar Synchro - In except of get_one_event_synchro") - pass + _logger.info(exception_to_unicode(e)) + return False return status_response(status) and content or False