From 278f9c9d87d349af65ae267ded10cff0ae5a142a Mon Sep 17 00:00:00 2001 From: Edwin Hermans Date: Wed, 29 May 2024 11:15:47 -0400 Subject: [PATCH] Make all http requests raise for status --- tyora/session.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tyora/session.py b/tyora/session.py index 9d29bc7..dbd9533 100644 --- a/tyora/session.py +++ b/tyora/session.py @@ -82,11 +82,12 @@ def login(self, username: str, password: str) -> None: login_form["session[login]"] = username login_form["session[password]"] = password - _ = self.post( + res = self.post( url=urljoin(res.url, action), headers={"referer": res.url}, data=login_form, ) + res.raise_for_status() if not self.is_logged_in: logger.debug(