Closed Rei-x closed 3 years ago
Please send me your code
async def main():
keystore_manager = KeystoreFileManager("keystore.json")
account_manager = AccountFileManager("account.json")
if not account_manager.account:
await account_manager.register_and_save(keystore_manager.key, "myToken", "mySymbol", "myPin")
client = VulcanHebe(keystore_manager.key, account_manager.account)
await client.select_student()
await client.close()
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
KeystoreFileManager and AccountFileManager are simple classes for json file handling. You can see all of the code here.
Can you try seeing if #56 fixes your problem?
edit. This is what printed out, when I added line in photo (I replaced my private data with xyz):
{'Id': XYZ, 'Value': 'xyz@gmail.com', 'FirstName': 'xyz', 'SecondName': None, 'Surname': 'xyz', 'DisplayName': 'xyz', 'LoginRole': 'Uczen'}
It seems like API returns None value and related package cannot convert it to string, so it shows up error.
Yes, probably the easiest (but I'm not sure if the best) option is to replace second_name: str = StringField(key="SecondName", required=False)
by second_name: str = StringField(key="SecondName", default="")
, please try this and give me a feedback.
Nevermind, I installed new version of vulcan-api in wrong virtual environment, now everything works perfectly with #56, thank you so much for help, again!
Like in title, I get TypeError when I'm trying to select student using vulcan hebe api.
TypeError: ("'second_name' must be (<class 'str'>,) (got None that is a <class 'NoneType'>)."