#NEWLINE# def GenerateUserAuthorizationURL( self , level = None ) : #NEWLINE# #INDENT# oauthSession = self . _oauthSession ( callback_uri = ( WEB_ROOT + reverse ( 'oauth_return' , kwargs = { #NEWLINE# #INDENT# 'service' : 'endomondo' , #NEWLINE# #UNINDENT# } ) ) ) #NEWLINE# tokens = oauthSession . fetch_request_token ( 'https://api.endomondo.com/oauth/request_token' ) #NEWLINE# redis_token_key = ( 'endomondo:oauth:%s' % self [ 'oauth_token' ] ) #NEWLINE# redis . setex ( redis_token_key , tokens [ 'oauth_token_secret' ] , timedelta ( hours = 24 ) ) #NEWLINE# return oauthSession . authorization_url ( 'https://www.endomondo.com/oauth/authorize' )