#NEWLINE# @ classmethod #NEWLINE# @ gen . coroutine #NEWLINE# def CreateProspective( cls , client , identity_key , user_id , timestamp ) : #NEWLINE# #INDENT# 'Creates identity for a new prospective user. This typically happens when photos are\n    shared with a contact that is not yet a Viewfinder user.\n    ' #NEWLINE# identity = ( yield gen . Task ( Identity . Query , client , identity_key , None , must_exist = False ) ) #NEWLINE# if ( identity is None ) : #NEWLINE# #INDENT# identity = Identity . CreateFromKeywords ( key = identity_key ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( ( cls . user_id is None ) or ( identity . user_id == user_id ) ) , ( 'the identity is already in use: %s' % identity ) #NEWLINE# #UNINDENT# identity . user_id = user_id #NEWLINE# identity . authority = 'Viewfinder' #NEWLINE# ( yield gen . Task ( identity . Update , client ) ) #NEWLINE# ( yield identity . _RewriteContacts ( client , timestamp ) ) #NEWLINE# raise gen . Return ( identity )