diff --git a/src/utils/contacts/generate_contact_list_to_register.py b/src/utils/contacts/generate_contact_list_to_register.py index ddd68b4..413496f 100644 --- a/src/utils/contacts/generate_contact_list_to_register.py +++ b/src/utils/contacts/generate_contact_list_to_register.py @@ -18,6 +18,15 @@ def generate_list_to_register(): break if _to_add: _contact_list_to_register.append(_contact) + _all_contacts = MONGO_STORE_MANAGER.get_all_contacts_to_book() + for _contact in _contact_list_to_register: + if _contact.last_name is None or len(_contact.last_name) == 0: + for _true_contact in _all_contacts: + if _true_contact.mail == _contact.mail: + _contact.last_name = _true_contact.last_name + _contact.phone = _true_contact.phone + _contact.passport = _true_contact.passport + _contact.first_name = _true_contact.first_name return _contact_list_to_register