contact-person-profile-csv-imp-local 0.0.21__py3-none-any.whl → 0.0.22__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -398,7 +398,6 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
398
398
  importer_id = self.__insert_importer(
399
399
  contact_id=contact_id, location_id=location_id,
400
400
  user_external_id=user_external_id,
401
- google_people_api_resource_name=contact_dict.get("resource_name"),
402
401
  data_source_instance_id=data_source_instance_id,
403
402
  data_source_type_id=data_source_type_id
404
403
  )
@@ -473,10 +472,13 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
473
472
  return groups_linked
474
473
 
475
474
  def __insert_link_contact_persons(self, contact_dict: dict, contact_id: int) -> dict:
475
+ if not contact_dict.get("first_name") and not contact_dict.get("last_name"):
476
+ return {}
476
477
  phones_local = PhonesLocal(is_test_data=self.is_test_data)
477
478
  contact_phone_number = contact_dict.get("phone1")
478
479
  if contact_phone_number:
479
- result_dict = phones_local.normalize_phone_number(original_number=contact_phone_number, region=None)
480
+ result_dict = phones_local.normalize_phone_number(
481
+ original_number=contact_phone_number, region=None)
480
482
  if result_dict:
481
483
  contact_normalized_phone_number = result_dict.get("full_number_normalized")
482
484
  else:
@@ -519,7 +521,7 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
519
521
  profile_id = DEFAULT_PROFILE_ID
520
522
  contact_notes = ContactNotesLocal(
521
523
  contact_dict=contact_dict, contact_id=contact_id, profile_id=profile_id)
522
- insert_information = contact_notes.insert_contact_notes_text_block()
524
+ insert_information = contact_notes.insert_contact_notes_text_block() or {}
523
525
  contact_note_id = insert_information.get("contact_note_id")
524
526
  return contact_note_id
525
527
 
@@ -531,7 +533,7 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
531
533
  contact_dict=contact_dict)
532
534
  contact_phone_ids = []
533
535
  for phone_number in phone_numbers:
534
- contact_phone_id = self.contact_phone.insert_contact_and_link_to_existing_or_new_phone(
536
+ process_phone_result_dict = self.contact_phone.insert_contact_and_link_to_existing_or_new_phone(
535
537
  contact_dict=contact_dict,
536
538
  phone_number=phone_number,
537
539
  contact_id=contact_id,
@@ -540,7 +542,7 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
540
542
  location_id=location_id,
541
543
  country_id=country_id
542
544
  )
543
- contact_phone_ids.append(contact_phone_id.get("contact_phone_id"))
545
+ contact_phone_ids.append(process_phone_result_dict.get("contact_phone_id"))
544
546
 
545
547
  return contact_phone_ids
546
548
 
@@ -591,8 +593,7 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
591
593
  return location_results
592
594
 
593
595
  def __insert_importer(self, contact_id: int, location_id: int, user_external_id: int,
594
- google_people_api_resource_name: str, data_source_type_id: int,
595
- data_source_instance_id: int) -> int:
596
+ data_source_type_id: int, data_source_instance_id: int) -> int:
596
597
  # TODO: Shall we consider the url of csv's as the following? Use Sql2Code. Use const enum
597
598
  if data_source_type_id == 16:
598
599
  url = "www.google.com"
@@ -609,7 +610,6 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
609
610
  entity_type_id=self.contact_entity_type_id,
610
611
  entity_id=contact_id, url=url,
611
612
  user_external_id=user_external_id,
612
- google_people_api_resource_name=google_people_api_resource_name
613
613
  )
614
614
 
615
615
  return importer_id
@@ -756,7 +756,7 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
756
756
  file_name: str,
757
757
  user_external_username: str, start_index: int, end_index: int) -> int:
758
758
  name = datetime.now(ZoneInfo("UTC")).strftime("%y%m%d %H%M%S") + " " + \
759
- user_external_username + " 'Google Contact- Google Contact CSV'"
759
+ user_external_username + " 'Google Contact- Google Contact CSV'"
760
760
  # TODO: move to data_source
761
761
  data_source_instance_id = super().insert(
762
762
  schema_name="data_source_instance",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: contact-person-profile-csv-imp-local
3
- Version: 0.0.21
3
+ Version: 0.0.22
4
4
  Summary: PyPI Package for Circles CSVToContactPersonProfile-local Local/Remote Python
5
5
  Home-page: https://github.com/circles-zone/contact-person-profile-csv-imp-local-python-package
6
6
  Author: Circles
@@ -1,7 +1,7 @@
1
- contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=ClFAP6ntBayUJuH-k4dgJkrml8-Wy55E4mJc3a0YHeg,41424
1
+ contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=jbteo17NMmH0LuPtgZxueHRZHwSgEjOFLy0S9A-Po5M,41350
2
2
  contact_person_profile_csv_imp_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  contact_person_profile_csv_imp_local/contact_person_profile_csv_imp_local_constants.py,sha256=eE0Bg2dCPrmG72K20k0_KOckc61C9cGSgH0Zgae_lbk,957
4
- contact_person_profile_csv_imp_local-0.0.21.dist-info/METADATA,sha256=2yl92Bd2snQzELayCR4qIbBIMPypqqU4PvZy5EBXAUM,1450
5
- contact_person_profile_csv_imp_local-0.0.21.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
- contact_person_profile_csv_imp_local-0.0.21.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
7
- contact_person_profile_csv_imp_local-0.0.21.dist-info/RECORD,,
4
+ contact_person_profile_csv_imp_local-0.0.22.dist-info/METADATA,sha256=kLjocgUHnrjlQc4fyueZzkrFpzyJ32sVPs7iU8wFucs,1450
5
+ contact_person_profile_csv_imp_local-0.0.22.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
6
+ contact_person_profile_csv_imp_local-0.0.22.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
7
+ contact_person_profile_csv_imp_local-0.0.22.dist-info/RECORD,,