Skip to content
Snippets Groups Projects
Unverified Commit 6ad1a36b authored by Martin Trigaux's avatar Martin Trigaux
Browse files

[FIX] google_calendar: correct migration to requests

Introduced at 01e35141
.code was on the previous urllib2 version but on requests, the code is accessed
through status_code

opw-1855471
parent 1b272a20
No related branches found
No related tags found
No related merge requests found
...@@ -677,7 +677,7 @@ class GoogleCalendar(models.AbstractModel): ...@@ -677,7 +677,7 @@ class GoogleCalendar(models.AbstractModel):
try: try:
all_event_from_google = self.get_event_synchro_dict(lastSync=lastSync) all_event_from_google = self.get_event_synchro_dict(lastSync=lastSync)
except requests.HTTPError as e: 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. # 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.cr.rollback()
self.env.user.write({'google_calendar_last_sync_date': False}) self.env.user.write({'google_calendar_last_sync_date': False})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment