From 9be15e2359f3771591610aef5ee2df568bc81ac8 Mon Sep 17 00:00:00 2001 From: Ward Van Heddeghem Date: Fri, 15 Mar 2024 19:50:39 +0100 Subject: [PATCH] Smma edge case fix --- src/mijnbib/mijnbibliotheek.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mijnbib/mijnbibliotheek.py b/src/mijnbib/mijnbibliotheek.py index b7ef36b..4a37ce9 100644 --- a/src/mijnbib/mijnbibliotheek.py +++ b/src/mijnbib/mijnbibliotheek.py @@ -263,7 +263,7 @@ 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") @@ -271,7 +271,7 @@ def extend_loans(self, extend_url: str, execute: bool = False) -> tuple[bool, di # 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: