kapi2289 / vulcan-api

Unofficial UONET+ e-register API
https://vulcan-api.readthedocs.io/
MIT License
72 stars 17 forks source link

TypeError: ("'second_name' must be (<class 'str'>,) (got None that is a <class 'NoneType'>).") #50

Closed Rei-x closed 3 years ago

Rei-x commented 3 years ago

When I'm trying to initialize Vulcan object by client = Vulcan(certificate), error is raised that "second_name" is None, which is true. When I add student['Imie2'] = "" in Student class in get method, everything works as expected.

  def get(cls, api):
      j = api.post(api.base_url + "UczenStart/ListaUczniow")

      for student in j.get("Data", []):
          student['Imie2'] = ""
          yield to_model(cls, cls.format_json(student))
kapi2289 commented 3 years ago

Can you try seeing if #51 fixes your problem?

Rei-x commented 3 years ago

Yea, now it works perfectly, thank you so much!