#NEWLINE# def log_duplicate_acount( dry ) : #NEWLINE# #INDENT# duplicate_emails = get_duplicate_email ( ) #NEWLINE# count = 0 #NEWLINE# if duplicate_emails : #NEWLINE# #INDENT# for email in duplicate_emails : #NEWLINE# #INDENT# users = User . find ( ( ( Q ( 'emails' , 'eq' , email ) & Q ( 'merged_by' , 'eq' , None ) ) & Q ( 'username' , 'ne' , None ) ) ) #NEWLINE# for user in users : #NEWLINE# #INDENT# count += 1 #NEWLINE# logger . info ( 'User {}, username {}, id {}, email {} is a duplicate' . format ( user . fullname , user . username , user . _id , user . emails ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# logger . info ( 'Found {} users with duplicate emails' . format ( count ) )