def check_account_exists(username=None, email=None):
 conflicts = []
 if ((email is not None) and User.objects.filter(email=email).exists()):
  conflicts.append('email')
 if ((username is not None) and User.objects.filter(username=username).exists()):
  conflicts.append('username')
 return conflicts

def check_account_exists ( username = None , email = None ) : conflicts = [ ] if ( ( email is not None ) and User . objects . filter ( email = email ) . exists ( ) ) : conflicts . append ( 'email' ) if ( ( username is not None ) and User . objects . filter ( username = username ) . exists ( ) ) : conflicts . append ( 'username' ) return conflicts
check whether an account with a particular username or email already exists .