need to use .get('messages') to not get a keyerror
authorRodney Ewing <ewing.rj@gmail.com>
Wed, 10 Jul 2013 18:08:28 +0000 (11:08 -0700)
committerRodney Ewing <ewing.rj@gmail.com>
Wed, 10 Jul 2013 18:08:28 +0000 (11:08 -0700)
mediagoblin/plugins/openid/views.py

index 9566e38effcc44824237fff5bf470333df0f4f7a..b639a4cb31744c68ba49efc523a1e12b20bd0364 100644 (file)
@@ -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')