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

Trap getting punishment #10

Open
ioull opened this issue Oct 4, 2024 · 1 comment
Open

Trap getting punishment #10

ioull opened this issue Oct 4, 2024 · 1 comment

Comments

@ioull
Copy link
Collaborator

ioull commented Oct 4, 2024

When accessing /punishments

I got an error 500 :

{"error":{"code":500,"description":"","message":"","type":"ParsingError"},"success":false}

And in the logs I got

2024-10-04 10:07:37,483 - pronote-rest - ERROR - Could not follow path
2024-10-04 10:07:37,483 - pronote-rest - ERROR - Could not follow path
Traceback (most recent call last):
  File "/home/app/.local/lib/python3.12/site-packages/pronotepy/dataClasses.py", line 220, in __call__
    json_value = json_value[p]
                 ~~~~~~~~~~^^^
KeyError: 'travailAFaire'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/app/.local/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/app/.local/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/app/app.py", line 310, in data_period
    if hasattr(p, type):
       ^^^^^^^^^^^^^^^^
  File "/home/app/.local/lib/python3.12/site-packages/pronotepy/dataClasses.py", line 641, in punishments
    return [Punishment(self._client, a) for a in absences if a["G"] == 41]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/app/.local/lib/python3.12/site-packages/pronotepy/dataClasses.py", line 2074, in __init__
    self.homework: str = self._resolver(str, "travailAFaire")
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/app/.local/lib/python3.12/site-packages/pronotepy/dataClasses.py", line 234, in __call__
    raise ParsingError(
pronotepy.exceptions.ParsingError: Could not follow path
2024-10-04 10:07:37,484 - werkzeug - INFO - 172.19.0.10 - - [04/Oct/2024 10:07:37] "GET /punishments HTTP/1.1" 500 -
@bdbogjoe
Copy link
Owner

bdbogjoe commented Oct 4, 2024

linked to : bain3/pronotepy#312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants