use source_from field from db

This commit is contained in:
2025-04-08 15:00:26 +02:00
parent 0f157eab37
commit d63a402a6d
4 changed files with 63 additions and 16 deletions
+8 -9
View File
@@ -18,7 +18,7 @@ DEFAULT_SERIAL_TO_IGNORE = ["47e7e36b", "bitbrowser"]
def upload_contacts_list():
_contacts_to_book = read_contacts(str(Path.home()) + "/Desktop/real_name_contacts_500_27_03_25_fixed_mac.xlsx")
_contacts_to_book = read_contacts(str(Path.home()) + "/Desktop/contact_list_2025-04-08.xlsx")
return _contacts_to_book
@@ -100,28 +100,27 @@ def write_new_contacts_to_excel(valid_contacts: list, file_name=str(datetime.dat
def generate_valid_contact_list_for_day(segment_number=1):
_collection_name = "2025-03-31"
_collection_name = "2025-04-07"
_valid_contact_list = MONGO_STORE_MANAGER.get_all_successful_items_for_one_day(_collection_name)
_all_contacts = MONGO_STORE_MANAGER.get_all_contacts_to_book()
_contact_to_save = []
for _contact in _valid_contact_list:
if _contact.mail == "wesley_barton477273@aol.com":
print("found")
# _contact.store = "faubourg"
_contact.store = "random"
# if _contact.last_name is None or len(_contact.last_name) == 0:
for _true_contact in _all_contacts:
if _true_contact.mail == _contact.mail:
if _contact.mail == "wesley_barton477273@aol.com":
print("found")
_contact.last_name = _true_contact.last_name
_contact.phone = _true_contact.phone
_contact.passport = _true_contact.passport
_contact.first_name = _true_contact.first_name
_contact.resident_card_number = _true_contact.resident_card_number
# if _contact.resident_card_number is None or len(_contact.resident_card_number) == 0:
# for _true_contact in _all_contacts:
# if _true_contact.mail == _contact.mail:
# _contact.resident_card_number = _true_contact.resident_card_number
_contact.source_from = _true_contact.source_from
# if len(_contact.serial) == 0:
# _contact.serial = DEFAULT_SERIAL
if _contact.url_validated:
if _contact.last_name is not None and len(_contact.last_name) > 0:
_need_to_save = True
@@ -276,4 +275,4 @@ if __name__ == '__main__':
# "/Users/lpan/Desktop/contact_list_2024-11-08.xlsx",
# "/Users/lpan/Desktop/contact_list_2024-11-06.xlsx"
# ])
# fix_phone_number_format(str(Path.home()) + "/Desktop/contact_list_2025-03-29_mac.xlsx")
# fix_phone_number_format(str(Path.home()) + "/Desktop/gmx_ch_100_2024-06-13.xlsx")