Commit d561b8c5 authored by Zeyu DONG's avatar Zeyu DONG
Browse files

a quick fix for login

parent c37987b5
Loading
Loading
Loading
Loading
+21 −17
Original line number Diff line number Diff line
@@ -47,7 +47,9 @@ def hot_load(module_name):


def do_login(url, username, password):
    soup_login = BeautifulSoup(login.get(url).content, 'html5lib')
    content = login.get(url).content
    try:
        soup_login = BeautifulSoup(content, 'html5lib')
        logger.info('Start to get login information')

        info = {}
@@ -70,7 +72,9 @@ def do_login(url, username, password):
        err = soup_response.find('div', {'class': 'errors', 'id': 'msg'})

        return success, err

    except Exception as err:
        logger.error("Error in login:\n%s", content.decode(), exc_info=True)
        return False, "Content error"

def test_network(url):
    with login.get(url, timeout=10, allow_redirects=False) as test: