X-Git-Url: http://git.veekun.com/zzz-spline-users.git/blobdiff_plain/318d3515bfcbe35451db3624b949ccd7a1d66720..1e2382335ea1e52b42cdc07fd1f74b9a9b0cec39:/spline/plugins/users/controllers/accounts.py diff --git a/spline/plugins/users/controllers/accounts.py b/spline/plugins/users/controllers/accounts.py index 09ca1ac..03c9392 100644 --- a/spline/plugins/users/controllers/accounts.py +++ b/spline/plugins/users/controllers/accounts.py @@ -61,7 +61,8 @@ class AccountsController(BaseController): sreg_res = SRegResponse.fromSuccessResponse(res) try: username = sreg_res['nickname'] - except KeyError: + except (KeyError, TypeError): + # KeyError if sreg has no nickname; TypeError if sreg is None username = 'Anonymous' # Create db records @@ -75,4 +76,4 @@ class AccountsController(BaseController): session['user_id'] = user.id session.save() - return "Hello, %s" % user.name + redirect_to(url('/'))