Commit df094f94 authored by Gabriel Dengler's avatar Gabriel Dengler
Browse files

Hopefully fixing bug when SSO fails

parent 26e24b76
......@@ -77,23 +77,11 @@ class Connection:
self.form_data['username'] = self.username
self.form_data['password'] = self.password
use_sso = True
if use_sso:
success = self.do_sso()
if not success:
return False
r = self.__get(url_exams_page)
self.url_exam_results = find_exam_results_url(r.content)
return self.url_exam_results is not None
else:
while True:
print_info(f'logging in as {self.username}')
self.__post(url_login_form, self.form_data)
while True:
try:
success = self.do_sso()
if not success:
return False
r = self.__get(url_exams_page)
self.url_exam_results = find_exam_results_url(r.content)
......@@ -101,7 +89,13 @@ class Connection:
if self.url_exam_results:
return True
time.sleep(1)
print_warn('exam results url not found')
except Exception as e:
print_warn(e)
time.wait(5)
def do_sso(self):
print(Style.DIM + 'generate auth state session...', end=' ', flush=True)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment