EdupageAPI / edupage-api

A python library for accessing your Edupage account
https://edupageapi.github.io/edupage-api/
GNU General Public License v3.0
66 stars 13 forks source link

[Bug] when using get_lunches() #45

Closed Kubk0 closed 2 years ago

Kubk0 commented 2 years ago

Describe the bug when using edupage.get_lunches() it throws an error saying that the Lunch class takes no arguments

Your code

edupage = Edupage()
edupage.login_auto("*my name*", "*my password*")

today = datetime.datetime.now()
lunch = edupage.get_lunches(today)
print(lunch)

Error message

Traceback (most recent call last):
  File "C:\Users\*my user name*\Desktop\obed.py", line 8, in <module>
    lunch = edupage.get_lunches(today)
  File "C:\Users\*my user name*\AppData\Local\Programs\Python\Python310\lib\site-packages\edupage_api\__init__.py", line 121, in get_lunches
    return Lunches(self).get_lunch(date)
  File "C:\Users\*my user name*\AppData\Local\Programs\Python\Python310\lib\site-packages\edupage_api\module.py", line 94, in __impl
    return method(self, *method_args, **method_kwargs)
  File "C:\Users\*my user name*\AppData\Local\Programs\Python\Python310\lib\site-packages\edupage_api\lunches.py", line 172, in get_lunch
    return Lunch(served_from, served_to, amount_of_foods,
TypeError: Lunch() takes no arguments

Expected behavior no error message outputs the lunch class Version

BelKed commented 2 years ago

Last week I got the same error when I tried to do something with lunch. After closer inspection of https://github.com/ivanhrabcak/edupage-api/commit/055a8f43f305025fec4fb76bf4ba0b03d20fb684 I see why it's not working :D

BelKed commented 2 years ago

Anyways, thanks for reporting this bug :)

Fixed in https://github.com/ivanhrabcak/edupage-api/commit/249f53e13de68bf655112e973550a02f147c8cc6. If you want to try it, uninstall your currently installed edupage-api package (pip uninstall edupage-api) and install it using the following command:

pip install git+https://github.com/ivanhrabcak/edupage-api@249f53e
ivanhrabcak commented 2 years ago

We can create a 0.9.981 bugfix release

Kubk0 commented 2 years ago

it works thanks!