Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Dec 13, 2024
1 parent fccb4e0 commit 91970cb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,8 @@ def write_creds():
# Get project_id to save it to de DB
utils.get_project_ids([creds])
# delete cached credentials
del session['creds']
if 'creds' in session:
del session['creds']
cred.write_creds(creds["id"], get_cred_id(), creds, cred_id in [None, ''])
if val_res == 0:
flash("Credentials successfully written!", 'success')
Expand All @@ -1188,7 +1189,8 @@ def delete_creds():
cred_id = request.args.get('cred_id', "")
try:
# delete cached credentials
del session['creds']
if 'creds' in session:
del session['creds']
cred.delete_cred(cred_id, get_cred_id())
flash("Credentials successfully deleted!", 'success')
except Exception as ex:
Expand All @@ -1207,7 +1209,8 @@ def enable_creds():
if val_res == 2:
flash(val_msg, 'warning')
# delete cached credentials
del session['creds']
if 'creds' in session:
del session['creds']
cred.enable_cred(cred_id, get_cred_id(), enable)
except Exception as ex:
flash("Error updating credentials %s!" % ex, 'error')
Expand Down

0 comments on commit 91970cb

Please sign in to comment.