Compare commits

..

No commits in common. "3b864412597742fc27af235f340de11e81001752" and "eac835bef51cfa7565bc5f9bf1d4931dcf7c8ed2" have entirely different histories.

1 changed files with 28 additions and 31 deletions

View File

@ -34,10 +34,7 @@ def connect(request):
def authorize(request): def authorize(request):
if request.user.userprofileinfo.discord_id: if request.user.userprofileinfo.discord_id:
return bad_request(request, "Already connected") return bad_request(request, "Already connected")
try:
token = oauth.discord.authorize_access_token(request) token = oauth.discord.authorize_access_token(request)
except:
bad_request(request, "Connection refused")
response = oauth.discord.get('users/@me', token=token) response = oauth.discord.get('users/@me', token=token)
response = response.json() response = response.json()
discord_id = response['id'] discord_id = response['id']