Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] lunches_data is an empty list at times #83

Open
reinum opened this issue Nov 26, 2024 · 1 comment
Open

[Bug] lunches_data is an empty list at times #83

reinum opened this issue Nov 26, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@reinum
Copy link
Contributor

reinum commented Nov 26, 2024

Describe the bug
The lunches_data in the edupage api.lunches returns [] at times and is not handled at all

Your code

...
lunch = edupage.get_lunches(date)
...

Error message

Traceback (most recent call last):
  File "/home/vertexxdev/Documents/Hobby Shit/lunchOrderer/dataGather.py", line 27, in <module>
    ordered_lunch = edupage.get_ordered_lunch(date)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vertexxdev/Documents/Hobby Shit/lunchOrderer/venv/lib/python3.12/site-packages/edupage_api/__init__.py", line 188, in get_ordered_lunch
    return Lunches(self).get_ordered_lunch(date)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vertexxdev/Documents/Hobby Shit/lunchOrderer/venv/lib/python3.12/site-packages/edupage_api/module.py", line 100, in __impl
    return method(self, *method_args, **method_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/vertexxdev/Documents/Hobby Shit/lunchOrderer/venv/lib/python3.12/site-packages/edupage_api/lunches.py", line 209, in get_ordered_lunch
    lunches_data = lunch_data.get(self.edupage.subdomain)
                   ^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'get'

Expected behavior
Return None or empty list.

Version

  • Edupage API version: 0.11.0
  • Python version: 3.12.6
@reinum reinum added the bug Something isn't working label Nov 26, 2024
@reinum
Copy link
Contributor Author

reinum commented Nov 26, 2024

can theoretically do a PR fixing this issue later myself but dont know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant