#NEWLINE# def lookup( self ) : #NEWLINE# #INDENT# '\n        Lookup existing account, if any.\n        ' #NEWLINE# assert ( not self . is_existing ) #NEWLINE# try : #NEWLINE# #INDENT# a = SocialAccount . objects . get ( provider = self . account . provider , uid = self . account . uid ) #NEWLINE# a . extra_data = self . account . extra_data #NEWLINE# self . account = a #NEWLINE# self . user = self . account . user #NEWLINE# a . save ( ) #NEWLINE# if ( app_settings . STORE_TOKENS and self . token ) : #NEWLINE# #INDENT# assert ( not self . token . pk ) #NEWLINE# try : #NEWLINE# #INDENT# t = SocialToken . objects . get ( account = self . account , app = self . token . app ) #NEWLINE# t . token = self . token . token #NEWLINE# if self . token . token_secret : #NEWLINE# #INDENT# t . token_secret = self . token . token_secret #NEWLINE# #UNINDENT# t . expires_at = self . token . expires_at #NEWLINE# t . save ( ) #NEWLINE# self . token = t #NEWLINE# #UNINDENT# except SocialToken . DoesNotExist : #NEWLINE# #INDENT# self . token . account = a #NEWLINE# self . token . save ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# except SocialAccount . DoesNotExist : #NEWLINE# #INDENT# pass