Skip to content

Commit

Permalink
Refactor fixmes ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
durden committed Jul 30, 2011
1 parent ec38124 commit 78a410b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/codrspace/views.py
Expand Up @@ -67,6 +67,8 @@ def signout(request):


def _validate_github_response(resp): def _validate_github_response(resp):
"""Raise exception if given response has error""" """Raise exception if given response has error"""

# FIXME: Handle error
if resp.status_code != 200 or 'error' in resp.content: if resp.status_code != 200 or 'error' in resp.content:
raise Exception('code: %u content: %s' % (resp.status_code, raise Exception('code: %u content: %s' % (resp.status_code,
resp.content)) resp.content))
Expand All @@ -93,13 +95,11 @@ def signin_callback(request, slug=None, template_name="base.html"):
'2b40ac4251871e09441eb4147cbd5575be48bde9', '2b40ac4251871e09441eb4147cbd5575be48bde9',
'code': code}) 'code': code})


# FIXME: Handle error
_validate_github_response(resp) _validate_github_response(resp)


token = _parse_github_access_token(resp.content) token = _parse_github_access_token(resp.content)
resp = requests.get('https://api.github.com/user?access_token=%s' % ( resp = requests.get('https://api.github.com/user?access_token=%s' % (
token)) token))
# FIXME: Handle error
_validate_github_response(resp) _validate_github_response(resp)
github_user = simplejson.loads(resp.content) github_user = simplejson.loads(resp.content)


Expand Down

0 comments on commit 78a410b

Please sign in to comment.