diff --git a/app.py b/app.py index 8ddb61a..1493541 100644 --- a/app.py +++ b/app.py @@ -1034,7 +1034,10 @@ def get_user_data(user_dn, conn): #ts = conn.entries[0].lastLogin.values[0] #ts = datetime.strptime(ts, '%Y-%m-%d %H:%M:%S%z') #ts = datetime.strftime(t, '%Y-%m-%d %H:%M:%S') - data.append(str(conn.entries[0].lastLogin.values[0])[:-6]) + if(conn.entries[0].lastLogin): + data.append(str(conn.entries[0].lastLogin.values[0])[:-6]) + else: + data.append(datetime.now().strftime('%Y-%m-%d %H:%M:%S')) data.append(conn.entries[0].secureAuth.values[0]) if(conn.entries[0].authCode): data.append(conn.entries[0].authCode.values[0])