              if not self.check_active(token.user):
                  raise exceptions.AuthenticationFailed('User not active: %s' % token.user.username)
  
              if consumer and token:
                  request.user = token.user
                  return (request.user, None)
  
              raise exceptions.AuthenticationFailed(
                  'You are not allowed to access this resource.')
  
          return None
 
</s> remove             except oauth2.Error, e:
                print "got e"
 </s> add             except oauth.Error, e: </s> remove         if oauth2 is None:
            raise ImproperlyConfigured("The 'python-oauth2' package could not be imported. It is required for use with the 'OAuthAuthentication' class.")
 </s> add         if oauth is None:
            raise ImproperlyConfigured("The 'oauth2' package could not be imported. It is required for use with the 'OAuthAuthentication' class.") </s> remove         return store.check_nonce(request, oauth_request, oauth_request['oauth_nonce'])
 </s> add         return oauth_provider.store.store.check_nonce(request, oauth_request, oauth_request['oauth_nonce']) </s> remove         :returns: two-tuple of (user, auth) if authentication succeeds, or None otherwise.
 </s> add         Returns two-tuple of (user, auth token) if authentication succeeds, or None otherwise. </s> remove     django-oath-plus"""
 </s> add     django-oath-plus and oauth2"""
                return (token.user, token)
              if not self.check_active(token.user):
                  raise exceptions.AuthenticationFailed('User not active: %s' % token.user.username)
  
              if consumer and token:
                return (token.user, token)
                return (token.user, token)
  
              raise exceptions.AuthenticationFailed(
                  'You are not allowed to access this resource.')
  
          return None
keep keep keep keep replace replace keep keep keep keep keep
 Move oauth2 and django-oauth-plus imports to compat and fix some minor issues

- alias oauth2 as oauth
- remove rouge print
- remove docstring markups
- OAuthAuthentication.authenticate() now returns (user, token) two-tuple on success
- don't set request.user because it's already set 
rest_framework/authentication.py