diff --git a/src/db/mongo_manager.py b/src/db/mongo_manager.py index 4f3e1c3..6037bae 100755 --- a/src/db/mongo_manager.py +++ b/src/db/mongo_manager.py @@ -22,7 +22,7 @@ EMAIL_LIST = "EMAIL_LIST" DESTINATION_EMAIL_LIST = "DESTINATION_EMAIL_LIST" LINKS_TO_VALIDATE = "LINKS_TO_VALIDATE" INVALID_EMAIL_LIST = "INVALID_EMAIL_LIST" -ADRESSE_LIST ="address" +ADRESSE_LIST = "address" class MongoDbManager: @@ -96,6 +96,7 @@ class MongoDbManager: except Exception as error: self.logger.info(error) return appointment_list_contacts + def get_all_address_list(self) -> list: collection_name = ADRESSE_LIST _address_list = [] @@ -329,6 +330,9 @@ class MongoDbManager: }, upsert=True) + def list_collection_names(self): + return self.db.list_collection_names() + MONGO_STORE_MANAGER = MongoDbManager() diff --git a/src/utils/contacts/check_all_collections.py b/src/utils/contacts/check_all_collections.py index 0860bdb..e801bfc 100644 --- a/src/utils/contacts/check_all_collections.py +++ b/src/utils/contacts/check_all_collections.py @@ -22,10 +22,10 @@ def get_all_not_used_mails(): not_used_emails = [] for mail_item in all_emails: if need_to_check_mail(mail_item.mail): - _need_to_add = False + _need_to_add = True for valid_contact in all_valid_contact_list: if valid_contact.mail == mail_item.mail: - _need_to_add = True + _need_to_add = False break if _need_to_add: not_used_emails.append(mail_item)