Описание проблемы
код:
data['lesson'] = message.text
await ns.login(
NS_LOGIN,
NS_PASSWORD,
NS_SCHOOL
)
diary = await ns.diary(
start=data['date']
)
print(diary)
await ns.logout()
await message.reply('test')
data['date']
это пропарсенная через dateparser строка, преобразованная в datetime.datetime
Каков ожидаемый результат?
Каков реальный результат?
Traceback (most recent call last):
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 417, in _process_polling_updates
for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 238, in process_updates
return await asyncio.gather(*tasks)
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/aiogram/dispatcher/dispatcher.py", line 259, in process_update
return await self.message_handlers.notify(update.message)
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/aiogram/dispatcher/handler.py", line 116, in notify
response = await handler_obj.handler(*args, **partial_data)
File "/home/ubuntu/snvmk-bot-py/main.py", line 68, in process_lesson
diary = await ns.diary(
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/netschoolapi/netschoolapi.py", line 172, in diary
return data.diary(diary_schema.load(response.json()))
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/marshmallow/schema.py", line 719, in load
return self._do_load(
File "/home/ubuntu/snvmk-bot-py/.venv/lib/python3.9/site-packages/marshmallow/schema.py", line 901, in _do_load
raise exc
marshmallow.exceptions.ValidationError: {'weekDays': {0: {'lessons': {0: {'room': ['Field may not be null.']}, 1: {'room': ['Field may not be null.']}, 2: {'room': ['Field may not be null.']}, 3: {'room': ['Field may not be null.']}, 4: {'room': ['Field may not be null.']}, 5: {'room': ['Field may not be null.']}}}, 1: {'lessons': {0: {'room': ['Field may not be null.']}, 1: {'room': ['Field may not be null.']}, 2: {'room': ['Field may not be null.']}, 3: {'room': ['Field may not be null.']}, 4: {'room': ['Field may not be null.']}, 5: {'room': ['Field may not be null.']}}}, 2: {'lessons': {0: {'room': ['Field may not be null.']}, 1: {'room': ['Field may not be null.']}, 2: {'room': ['Field may not be null.']}, 3: {'room': ['Field may not be null.']}, 4: {'room': ['Field may not be null.']}, 5: {'room': ['Field may not be null.']}}}, 3: {'lessons': {0: {'room': ['Field may not be null.']}, 1: {'room': ['Field may not be null.']}, 2: {'room': ['Field may not be null.']}, 3: {'room': ['Field may not be null.']}, 4: {'room': ['Field may not be null.']}}}}}
Дополнительные детали / скриншот
Используеться в aiogram телеграм боте