Use BMConfigParser.safeGetBoolean() in the methods for send* API commands
This commit is contained in:
parent
006632f5d1
commit
0a2470ebb7
10
src/api.py
10
src/api.py
|
@ -1117,10 +1117,8 @@ class BMRPCDispatcher(object):
|
|||
toAddress = addBMIfNotPresent(toAddress)
|
||||
fromAddress = addBMIfNotPresent(fromAddress)
|
||||
self._verifyAddress(fromAddress)
|
||||
try:
|
||||
fromAddressEnabled = self.config.getboolean(
|
||||
fromAddress, 'enabled')
|
||||
except BaseException:
|
||||
fromAddressEnabled = self.config.safeGetBoolean(fromAddress, 'enabled')
|
||||
if fromAddressEnabled is None:
|
||||
raise APIError(
|
||||
13, 'Could not find your fromAddress in the keys.dat file.')
|
||||
if not fromAddressEnabled:
|
||||
|
@ -1163,9 +1161,7 @@ class BMRPCDispatcher(object):
|
|||
TTL = 28 * 24 * 60 * 60
|
||||
fromAddress = addBMIfNotPresent(fromAddress)
|
||||
self._verifyAddress(fromAddress)
|
||||
try:
|
||||
self.config.getboolean(fromAddress, 'enabled')
|
||||
except BaseException:
|
||||
if not self.config.safeGetBoolean(fromAddress, 'enabled'):
|
||||
raise APIError(
|
||||
13, 'Could not find your fromAddress in the keys.dat file.')
|
||||
toAddress = str_broadcast_subscribers
|
||||
|
|
Reference in New Issue
Block a user