Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Switch user ids to id36s for consistency and str type keys.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromakode authored and Logan Hanks committed Jul 3, 2012
1 parent ecfc317 commit f608bb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions r2/r2/controllers/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def POST_authorize(self, authorize, client, redirect_uri, scope, state):
self._check_redirect_uri(client, redirect_uri)

if not c.errors:
code = OAuth2AuthorizationCode._new(client._id, redirect_uri, c.user._id, scope)
code = OAuth2AuthorizationCode._new(client._id, redirect_uri, c.user._id36, scope)
resp = {"code": code._id, "state": state}
return self.redirect(redirect_uri+"?"+urlencode(resp), code=302)
else:
Expand Down Expand Up @@ -213,7 +213,7 @@ def pre(self):
access_token = OAuth2AccessToken.get_token(self._get_bearer_token())
require(access_token)
c.oauth2_access_token = access_token
account = Account._byID(access_token.user_id, data=True)
account = Account._byID36(access_token.user_id, data=True)
require(account)
require(not account._deleted)
c.oauth_user = account
Expand Down
2 changes: 0 additions & 2 deletions r2/r2/models/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ class OAuth2AuthorizationCode(OAuth2Token):
used=False,
)
_bool_props = ("used",)
_int_props = ("user_id",)
_warn_on_partial_ttl = False
_use_db = True
_connection_pool = 'main'
Expand Down Expand Up @@ -246,7 +245,6 @@ class OAuth2AccessToken(OAuth2Token):
_defaults = dict(scope="",
token_type="bearer",
)
_int_props = ("user_id",)
_use_db = True
_connection_pool = 'main'

Expand Down

0 comments on commit f608bb3

Please sign in to comment.