From: Rodney Ewing Date: Wed, 10 Jul 2013 18:08:28 +0000 (-0700) Subject: need to use .get('messages') to not get a keyerror X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=537ce5973aef0c392be620d24993831812515df5;p=mediagoblin.git need to use .get('messages') to not get a keyerror --- diff --git a/mediagoblin/plugins/openid/views.py b/mediagoblin/plugins/openid/views.py index 9566e38e..b639a4cb 100644 --- a/mediagoblin/plugins/openid/views.py +++ b/mediagoblin/plugins/openid/views.py @@ -342,7 +342,7 @@ def delete_openid(request): form.openid.errors.append( _('That OpenID is not registered to this account.')) - if not form.errors and not request.session['messages']: + if not form.errors and not request.session.get('messages'): # Okay to continue with deleting openid return_to = request.urlgen( 'mediagoblin.plugins.openid.finish_delete')