[fix] avoid cases where get_cookie returns None

Reference https://bottlepy.org/docs/dev/api.html#bottle.BaseRequest.get_cookie

Might now be the most beautiful solution ever but at least it will produce a real error message.
This commit is contained in:
Bram 2018-04-29 17:17:43 +02:00 committed by GitHub
parent 97f8593ba1
commit 1830b229a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -438,7 +438,7 @@ class _ActionsMapPlugin(object):
try:
s_secret = self.secrets[s_id]
s_hash = request.get_cookie('session.hashes',
secret=s_secret)[authenticator.name]
secret=s_secret, default={})[authenticator.name]
except KeyError:
if authenticator.name == 'default':
msg = m18n.g('authentication_required')