Added one more type check for HoloUser init
This commit is contained in:
parent
1d5ebd02fe
commit
41eb6e46ee
@ -100,10 +100,10 @@ class HoloUser():
|
|||||||
self.locale = holo_user["tg_locale"]
|
self.locale = holo_user["tg_locale"]
|
||||||
self.username = holo_user["tg_username"]
|
self.username = holo_user["tg_username"]
|
||||||
|
|
||||||
if isinstance(user, User) and ((self.name != user.first_name) and (user.first_name is None)):
|
if isinstance(user, User) and ((self.name != user.first_name) and (user.first_name is not None)):
|
||||||
self.set("tg_name", user.first_name)
|
self.set("tg_name", user.first_name)
|
||||||
|
|
||||||
if isinstance(user, User) and (self.phone != user.phone_number):
|
if isinstance(user, User) and ((self.phone != user.phone_number) and (user.phone_number is not None)):
|
||||||
self.set("tg_phone", user.phone_number)
|
self.set("tg_phone", user.phone_number)
|
||||||
|
|
||||||
if isinstance(user, User) and ((self.locale != user.language_code) and (user.language_code is not None)):
|
if isinstance(user, User) and ((self.locale != user.language_code) and (user.language_code is not None)):
|
||||||
|
Reference in New Issue
Block a user