[FIX] google_account: sync of event deleted google side
When creating and deleting (disabling, actually)an event without syncyng with google, this is possible that Google returns a 404 status page, meaning the event we are trying to delete google side do not exist. We can safely ignore these 404 pages, as the event are not anymore existing in Odoo side either opw-627767
This commit is contained in:
parent
13b36ac677
commit
e92e633e64
|
@ -137,6 +137,7 @@ class google_service(osv.osv_memory):
|
||||||
|
|
||||||
status = 418
|
status = 418
|
||||||
response = ""
|
response = ""
|
||||||
|
ask_time = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
||||||
try:
|
try:
|
||||||
if type.upper() == 'GET' or type.upper() == 'DELETE':
|
if type.upper() == 'GET' or type.upper() == 'DELETE':
|
||||||
data = werkzeug.url_encode(params)
|
data = werkzeug.url_encode(params)
|
||||||
|
@ -159,13 +160,16 @@ class google_service(osv.osv_memory):
|
||||||
try:
|
try:
|
||||||
ask_time = datetime.strptime(request.headers.get('date'), "%a, %d %b %Y %H:%M:%S %Z")
|
ask_time = datetime.strptime(request.headers.get('date'), "%a, %d %b %Y %H:%M:%S %Z")
|
||||||
except:
|
except:
|
||||||
ask_time = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
|
pass
|
||||||
except urllib2.HTTPError, e:
|
except urllib2.HTTPError, e:
|
||||||
if e.code in (400, 401, 410):
|
if e.code in (400, 401, 410):
|
||||||
raise e
|
raise e
|
||||||
|
elif e.code in (204, 404):
|
||||||
_logger.exception("Bad google request : %s !" % e.read())
|
status = e.code
|
||||||
raise self.pool.get('res.config.settings').get_config_warning(cr, _("Something went wrong with your request to google"), context=context)
|
response = ""
|
||||||
|
else:
|
||||||
|
_logger.exception("Bad google request : %s !" % e.read())
|
||||||
|
raise self.pool.get('res.config.settings').get_config_warning(cr, _("Something went wrong with your request to google"), context=context)
|
||||||
return (status, response, ask_time)
|
return (status, response, ask_time)
|
||||||
|
|
||||||
def get_base_url(self, cr, uid, context=None):
|
def get_base_url(self, cr, uid, context=None):
|
||||||
|
|
Loading…
Reference in New Issue