From 6ad1a36b6eba2fcfee79641bde56cf6c4180001f Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Tue, 5 Jun 2018 16:44:08 +0200 Subject: [PATCH] [FIX] google_calendar: correct migration to requests Introduced at 01e3514 .code was on the previous urllib2 version but on requests, the code is accessed through status_code opw-1855471 --- addons/google_calendar/models/google_calendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/google_calendar/models/google_calendar.py b/addons/google_calendar/models/google_calendar.py index b9392bec08b..a422438778c 100644 --- a/addons/google_calendar/models/google_calendar.py +++ b/addons/google_calendar/models/google_calendar.py @@ -677,7 +677,7 @@ class GoogleCalendar(models.AbstractModel): try: all_event_from_google = self.get_event_synchro_dict(lastSync=lastSync) except requests.HTTPError as e: - if e.response.code == 410: # GONE, Google is lost. + if e.response.status_code == 410: # GONE, Google is lost. # we need to force the rollback from this cursor, because it locks my res_users but I need to write in this tuple before to raise. self.env.cr.rollback() self.env.user.write({'google_calendar_last_sync_date': False})