Show error when loading an account with invalid or expired tokens. Fixes #328

This commit is contained in:
2020-05-29 11:17:18 -05:00
parent ed5b66d033
commit 4fa983a314
3 changed files with 14 additions and 3 deletions

View File

@@ -21,7 +21,7 @@ from sessions.twitter import session
from . import manager
import config_utils
import config
from twython.exceptions import TwythonAuthError
log = logging.getLogger("sessionmanager.sessionManager")
class sessionManagerController(object):
@@ -85,11 +85,18 @@ class sessionManagerController(object):
s = session.Session(i)
s.get_configuration()
if i not in config.app["sessions"]["ignored_sessions"]:
s.login()
try:
s.login()
except TwythonAuthError:
self.show_auth_error(s.settings["twitter"]["user_name"])
continue
sessions.sessions[i] = s
self.new_sessions[i] = s
# self.view.destroy()
def show_auth_error(self, user_name):
error = view.auth_error(user_name)
def manage_new_account(self, *args, **kwargs):
if self.view.new_account_dialog() == widgetUtils.YES:
location = (str(time.time())[-6:])