diff --git a/invenio_accounts/views/security.py b/invenio_accounts/views/security.py index 29e11b80..42c604e1 100644 --- a/invenio_accounts/views/security.py +++ b/invenio_accounts/views/security.py @@ -27,10 +27,14 @@ def security(): if SessionActivity.is_current(session.sid_s): master_session = session del sessions[index] + + # If the master session is still `None`, filter it out + sessions = [master_session] + sessions if master_session is not None else sessions + return render_template( current_app.config["ACCOUNTS_SETTINGS_SECURITY_TEMPLATE"], formclass=RevokeForm, - sessions=[master_session] + sessions, + sessions=sessions, is_current=SessionActivity.is_current, )