+ Add error handler for set security pin
This commit is contained in:
parent
ad85ec0bfc
commit
4f309f40e6
@ -410,6 +410,9 @@ class CM_BOT:
|
||||
data=security_data,
|
||||
headers=self.set_security_pin_headers
|
||||
)
|
||||
if 'java.lang.NullPointerException' in response.text:
|
||||
return False
|
||||
return True
|
||||
|
||||
def transfer_credit(self, t_username: str, t_password: str, amount: float):
|
||||
token = self.get_transfer_token()
|
||||
|
||||
@ -137,7 +137,9 @@ class CM_BOT_HAL:
|
||||
username = f_username,
|
||||
password = password
|
||||
)
|
||||
cm_bot.set_security_pin(self.security_pin)
|
||||
if cm_bot.set_security_pin(self.security_pin) == False:
|
||||
cm_bot.logout()
|
||||
raise Exception(f'Agent acc: {f_username} already has security pin!')
|
||||
cm_bot.logout()
|
||||
|
||||
result = self.update_user_status_to_done(f_username)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user