From 2c9f6967789de555337216a83a821e32590b4ad5 Mon Sep 17 00:00:00 2001 From: Vasya Pupkin Date: Sun, 5 Nov 2017 06:42:43 +0300 Subject: [PATCH] Proper fix for #74 --- .../home/actions/main/restore_session.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/modules/home/actions/main/restore_session.py b/app/modules/home/actions/main/restore_session.py index 215ee53..f780bbe 100755 --- a/app/modules/home/actions/main/restore_session.py +++ b/app/modules/home/actions/main/restore_session.py @@ -13,20 +13,20 @@ def run(self): if session is not None: same = False - same_path = (session['Right']['path'] == session['Left']['path']) - same_type = (session['Right']['type'] == session['Left']['type']) + same_path = (session['Right'].get('path') == session['Left'].get('path')) + same_type = (session['Right'].get('type') == session['Left'].get('type')) if same_type and same_path: - if session['Left']['type'] == FM.Modules.WEBDAV: - if session['Left']['server_id'] == session['Left']['server_id']: + if session['Left'].get('type') == FM.Modules.WEBDAV: + if session['Left'].get('server_id') == session['Left'].get('server_id'): same = True - if session['Left']['type'] == FM.Modules.SFTP: - if session['Left']['server_id'] == session['Left']['server_id']: + if session['Left'].get('type') == FM.Modules.SFTP: + if session['Left'].get('server_id') == session['Left'].get('server_id'): same = True - if session['Left']['type'] == FM.Modules.FTP: - if session['Left']['server_id'] == session['Left']['server_id']: + if session['Left'].get('type') == FM.Modules.FTP: + if session['Left'].get('server_id') == session['Left'].get('server_id'): same = True - if session['Left']['type'] == FM.Modules.HOME: + if session['Left'].get('type') == FM.Modules.HOME: same = True message = {