[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
This commit is contained in:
Jeremy Kersten 2016-07-26 10:15:26 +02:00
parent 78f00700e3
commit e1c55b2d2d
1 changed files with 3 additions and 2 deletions

View File

@ -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