From e45726fd7ced72e3bde11bab3d116486b89ec406 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Mon, 23 Jul 2018 09:46:29 +0200 Subject: [PATCH] [Refactor] Make the session list a list comprehension in account.py --- calsocial/account.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/calsocial/account.py b/calsocial/account.py index bebf8cc..57ac972 100644 --- a/calsocial/account.py +++ b/calsocial/account.py @@ -206,11 +206,8 @@ class AccountBlueprint(Blueprint, RoutedMixin): """View the list of active sessions """ - sessions = [] - - for sid in current_user.active_sessions: - session = current_app.session_interface.load_session(sid) - sessions.append(session) + sessions = [current_app.session_interface.load_session(sid) + for sid in current_user.active_sessions] return render_template('account/active-sessions.html', sessions=sessions)