Browse Source

[FIX] we're on v7, pass timeout as named parameter

pull/304/head
Holger Brunn 9 years ago
parent
commit
d88f05f1d4
  1. 7
      dead_mans_switch_client/models/dead_mans_switch_client.py

7
dead_mans_switch_client/models/dead_mans_switch_client.py

@ -63,8 +63,9 @@ class DeadMansSwitchClient(orm.AbstractModel):
if not url: if not url:
logger.error('No server configured!') logger.error('No server configured!')
return return
timeout = self.env['ir.config_parameter'].get_param(
'dead_mans_switch_client.send_timeout', SEND_TIMEOUT)
timeout = self.pool['ir.config_parameter'].get_param(
cr, uid, 'dead_mans_switch_client.send_timeout', SEND_TIMEOUT,
context=context)
data = self._get_data(cr, uid, context=context) data = self._get_data(cr, uid, context=context)
logger.debug('sending %s', data) logger.debug('sending %s', data)
urllib2.urlopen( urllib2.urlopen(
@ -78,4 +79,4 @@ class DeadMansSwitchClient(orm.AbstractModel):
{ {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
}), }),
timeout)
timeout=timeout)
Loading…
Cancel
Save