Skip to content

Commit

Permalink
Smma edge case fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wvanhed committed Mar 15, 2024
1 parent 99648fb commit 9be15e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mijnbib/mijnbibliotheek.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,15 @@ def extend_loans(self, extend_url: str, execute: bool = False) -> tuple[bool, di
raise e

# disclaimer: not sure if other codes are realistic
success = response.code == 200
success = response.code == 200 if response is not None else False

if success:
_log.debug("Looks like extending the loan(s) was successful")

# Try to add result details, but don't fail if we fail to parse details, it's tricky :-)
try:
# On submit, we arrive at "uitleningen" (loans) page, which lists the result
html_string = response.read().decode("utf-8")
html_string = response.read().decode("utf-8") # type:ignore
# Path("response.html").write_text("html_string") # for debugging
details = ExtendResponsePageParser(html_string).parse()
if "likely_success" in details and details["likely_success"] is False:
Expand Down

0 comments on commit 9be15e2

Please sign in to comment.