From 0a02eb2033217c9feffda5c322f88b96ecbb7607 Mon Sep 17 00:00:00 2001 From: piair Date: Wed, 28 Feb 2024 14:44:01 +0100 Subject: [PATCH] fix json start --- modules/Classes/UserCredentials.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/Classes/UserCredentials.py b/modules/Classes/UserCredentials.py index 820a780..6e9ba59 100644 --- a/modules/Classes/UserCredentials.py +++ b/modules/Classes/UserCredentials.py @@ -1,5 +1,3 @@ -import json - from pyotp import TOTP from modules.Tools.logger import debug, warning @@ -12,7 +10,8 @@ class UserCredentials: self.total = 0 def add(self, username: str, password: str, tfa: str = None): - debug(f"adding account with data : Username: {username}, Password: {password}, 2FA: {'None' if tfa == '' else tfa}") + debug( + f"adding account with data : Username: {username}, Password: {password}, 2FA: {'None' if tfa == '' else tfa}") self.data[self.total] = { "username": username, "password": password, @@ -36,7 +35,10 @@ class UserCredentials: def next_account(self): self.current += 1 - debug(f"New credentials: {self.data[self.current]}") + if self.is_valid(): + debug(f"New credentials: {self.data[self.current]}") + else: + debug("No new credentials.") def is_valid(self): return self.current < self.total