Commit a1786bd6 authored by Daniele Venzano's avatar Daniele Venzano

Give helpful message when email is not set to public in GitLab

parent dea70812
......@@ -169,7 +169,12 @@ class UserOAuthCallbackAPI(ZoeAPIRequestHandler):
self.redirect(self.reverse_url("login"))
return
data = resp.json()
email = data['email']
try:
email = data['email']
except KeyError:
with_gitlab_oauth = zoe_lib.config.get_conf().oauth_client_id != ''
self.render('login.jinja2', error='Email address not set to public in GitLab settings', with_gitlab_oauth=with_gitlab_oauth)
return
username = data['nickname']
user = self.api_endpoint.user_by_name(username)
if user is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment