added resident_card_number field
This commit is contained in:
@@ -66,7 +66,7 @@ def generate_not_used_contact_list():
|
||||
if contact.mail == mail_item.mail:
|
||||
if contact.phone is not None and len(contact.phone) > 0:
|
||||
new_contact = ContactPojo(mail=mail_item.mail, phone_number=contact.phone,
|
||||
passport_number=contact.passport,
|
||||
passport=contact.passport,
|
||||
last_name=contact.last_name, first_name=contact.first_name,
|
||||
store="random")
|
||||
contact_list.append(new_contact)
|
||||
@@ -75,7 +75,7 @@ def generate_not_used_contact_list():
|
||||
|
||||
|
||||
def upload_to_collection():
|
||||
_contacts = read_contacts(str(Path.home()) + "/Desktop/contact_list_2024-11-05.xlsx")
|
||||
_contacts = read_contacts(str(Path.home()) + "/Desktop/contact_list_2025-01-06.xlsx")
|
||||
MONGO_STORE_MANAGER.upload_contact_list_to_collection(_contacts,"CONTACT_LIST_SERIAL_MAP")
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ def get_contact_list() -> list:
|
||||
for item in _successful_items:
|
||||
if item.url_validated:
|
||||
_contact = ContactPojo(first_name=item.first_name, last_name=item.last_name, mail=item.mail,
|
||||
phone_number=item.phone, passport_number=item.passport, store=item.store)
|
||||
phone_number=item.phone, passport=item.passport, store=item.store)
|
||||
_contact.ip_address = item.ip_address
|
||||
_contact.created_at = item.created_at
|
||||
_contact_list.append(_contact)
|
||||
|
||||
@@ -56,11 +56,14 @@ def read_contacts(file_name) -> list:
|
||||
contact = ContactPojo(phone_number=contact_dict['phone'],
|
||||
last_name=last_name,
|
||||
first_name=first_name,
|
||||
passport_number=contact_dict['passport'],
|
||||
passport=contact_dict['passport'],
|
||||
mail=contact_dict['email'], store=store)
|
||||
if contact_dict.get('serial') is not None:
|
||||
serial = contact_dict['serial']
|
||||
contact.serial = serial
|
||||
if contact_dict.get('resident_card_number') is not None:
|
||||
resident_card_number = contact_dict['resident_card_number']
|
||||
contact.resident_card_number = resident_card_number
|
||||
contact.ip_country = ip_country
|
||||
contact.ua = ua
|
||||
contact_list.append(contact)
|
||||
@@ -135,7 +138,7 @@ class ExcelHelper:
|
||||
contact = ContactPojo(phone_number="",
|
||||
last_name=last_name,
|
||||
first_name=first_name,
|
||||
passport_number="",
|
||||
passport="",
|
||||
mail="")
|
||||
|
||||
if len(first_name) == 0:
|
||||
|
||||
@@ -94,7 +94,7 @@ if __name__ == '__main__':
|
||||
# mail_list = db_manager.get_destination_emails()[50:200]
|
||||
generate_contacts = []
|
||||
for mail in mail_list:
|
||||
contact = ContactPojo(mail=mail.mail, phone_number="", passport_number="", last_name="", first_name="")
|
||||
contact = ContactPojo(mail=mail.mail, phone_number="", passport="", last_name="", first_name="")
|
||||
spliteed = mail.mail.split("@")
|
||||
possible_name_list = generate_name_from_email(spliteed[0])[0]
|
||||
chinese_name_list = generate_name_from_email(spliteed[0])[1]
|
||||
|
||||
Reference in New Issue
Block a user