Browse Source

[FIX] flake8 errors

pull/80/head
Damien Crier 9 years ago
parent
commit
4e90cb29ba
  1. 8
      asterisk_click2dial/asterisk_click2dial.py
  2. 5
      base_phone/wizard/reformat_all_phonenumbers.py

8
asterisk_click2dial/asterisk_click2dial.py

@ -255,15 +255,15 @@ class asterisk_server(orm.Model):
break break
# 6 = Up # 6 = Up
if ( if (
chan.get('ChannelState') == '6'
and sip_account in chan.get('BridgedChannel', '')):
chan.get('ChannelState') == '6' and
sip_account in chan.get('BridgedChannel', '')):
_logger.debug("Found a matching Event in 'Up' state") _logger.debug("Found a matching Event in 'Up' state")
calling_party_number = chan.get('CallerIDNum') calling_party_number = chan.get('CallerIDNum')
break break
# Compatibility with Asterisk 1.4 # Compatibility with Asterisk 1.4
if ( if (
chan.get('State') == 'Up'
and sip_account in chan.get('Link', '')):
chan.get('State') == 'Up' and
sip_account in chan.get('Link', '')):
_logger.debug("Found a matching Event in 'Up' state") _logger.debug("Found a matching Event in 'Up' state")
calling_party_number = chan.get('CallerIDNum') calling_party_number = chan.get('CallerIDNum')
break break

5
base_phone/wizard/reformat_all_phonenumbers.py

@ -78,9 +78,8 @@ class reformat_all_phonenumbers(models.TransientModel):
obj._description, name, unicode(e))) obj._description, name, unicode(e)))
continue continue
if any( if any(
[init_entry.get(field)
!= entry.get(field) for field
in fields]):
[init_entry.get(field) != entry.get(field) for
field in fields]):
entry.pop('id') entry.pop('id')
logger.info( logger.info(
'[%s] Reformating phone number: FROM %s TO %s' % ( '[%s] Reformating phone number: FROM %s TO %s' % (

Loading…
Cancel
Save