Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 55c9e82

Browse files
committed
Use get() instead of try/except
1 parent 3d498e8 commit 55c9e82

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

flask_rp/views.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ def finalize(op_hash, request_args):
102102
except KeyError:
103103
return make_response('Unknown state', 400)
104104

105-
try:
106-
session['session_state'] = request_args['session_state']
107-
except KeyError:
108-
session['session_state'] = ''
105+
session['session_state'] = request_args.get('session_state', '')
109106

110107
logger.debug('Issuer: {}'.format(iss))
111108
res = current_app.rph.finalize(iss, request_args)

0 commit comments

Comments
 (0)