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)
|
toAddress = addBMIfNotPresent(toAddress)
|
||||||
fromAddress = addBMIfNotPresent(fromAddress)
|
fromAddress = addBMIfNotPresent(fromAddress)
|
||||||
self._verifyAddress(fromAddress)
|
self._verifyAddress(fromAddress)
|
||||||
try:
|
fromAddressEnabled = self.config.safeGetBoolean(fromAddress, 'enabled')
|
||||||
fromAddressEnabled = self.config.getboolean(
|
if fromAddressEnabled is None:
|
||||||
fromAddress, 'enabled')
|
|
||||||
except BaseException:
|
|
||||||
raise APIError(
|
raise APIError(
|
||||||
13, 'Could not find your fromAddress in the keys.dat file.')
|
13, 'Could not find your fromAddress in the keys.dat file.')
|
||||||
if not fromAddressEnabled:
|
if not fromAddressEnabled:
|
||||||
|
@ -1163,9 +1161,7 @@ class BMRPCDispatcher(object):
|
||||||
TTL = 28 * 24 * 60 * 60
|
TTL = 28 * 24 * 60 * 60
|
||||||
fromAddress = addBMIfNotPresent(fromAddress)
|
fromAddress = addBMIfNotPresent(fromAddress)
|
||||||
self._verifyAddress(fromAddress)
|
self._verifyAddress(fromAddress)
|
||||||
try:
|
if not self.config.safeGetBoolean(fromAddress, 'enabled'):
|
||||||
self.config.getboolean(fromAddress, 'enabled')
|
|
||||||
except BaseException:
|
|
||||||
raise APIError(
|
raise APIError(
|
||||||
13, 'Could not find your fromAddress in the keys.dat file.')
|
13, 'Could not find your fromAddress in the keys.dat file.')
|
||||||
toAddress = str_broadcast_subscribers
|
toAddress = str_broadcast_subscribers
|
||||||
|
|
Reference in New Issue
Block a user