Fixed manual addition of users to the autocomplete users database

This commit is contained in:
Manuel Cortez 2021-10-28 13:18:02 -05:00
parent 307ed093af
commit 6739045cce

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import widgetUtils import widgetUtils
from tweepy.errors import TweepyException
from . import storage, wx_manage from . import storage, wx_manage
from wxUI import commonMessageDialogs from wxUI import commonMessageDialogs
@ -27,8 +28,9 @@ class autocompletionManage(object):
if usr == False: if usr == False:
return return
try: try:
data = self.session.twitter.twitter.get_user(screen_name=usr) data = self.session.twitter.get_user(screen_name=usr)
except: except TweepyException as e:
log.exception("Exception raised when attempting to add an user to the autocomplete database manually.")
self.dialog.show_invalid_user_error() self.dialog.show_invalid_user_error()
return return
self.database.set_user(data.screen_name, data.name, 0) self.database.set_user(data.screen_name, data.name, 0)