organizations-local 0.0.29__tar.gz → 0.0.31__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: organizations-local
3
- Version: 0.0.29
3
+ Version: 0.0.31
4
4
  Summary: PyPI Package for Circles organizations-local Python
5
5
  Home-page: https://github.com/circles-zone/organizations-local-python-package
6
6
  Author: Circles
@@ -167,6 +167,7 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
167
167
 
168
168
  return organizations_names_list
169
169
 
170
+ # Edited by Tal Goodman on 12.7.24
170
171
  def get_organizations_ids_and_names_list_by_organizations_ids(
171
172
  self, *, organizations_ids_list: list[int], lang_codes_list: list[LangCode] = None,
172
173
  view_table_name: str = None) -> list[tuple[int, str]]:
@@ -198,18 +199,34 @@ class OrganizationsLocal(GenericCRUDML, metaclass=MetaLogger,
198
199
  return test_organization_id
199
200
 
200
201
  # If we add the support of multiple organizations per contact, We will have to fix this method
202
+ # Edited by Tal Goodman on 12.7.24
201
203
  def get_update_status_and_information_list(self, *, last_modified_timestamp: str, main_profile_id: int) -> list[dict]:
202
204
  if main_profile_id is None:
203
205
  return UpdateStatus.UPDATE_CIRCLEZ
204
206
  sync_conflict_resolution = SyncConflictResolution()
207
+ # TODO: Shall we also check update_timestamp in organization_table to see if the name was changed?
205
208
  update_status_and_information_list: list[dict] = sync_conflict_resolution.get_update_status_and_information_list_by_where(
206
- schema_name=DEFAULT_SCHEMA_NAME, view_table_name="organization_profile_view",
209
+ schema_name="organization_profile", view_table_name="organization_profile_view",
207
210
  where="profile_id = %s", params=(main_profile_id,), local_last_modified_column_name="updated_timestamp",
208
211
  remote_last_modified_timestamp=last_modified_timestamp)
209
212
  # Add organization_names to update_status_and_information_list
210
- organization_names_list = self.get_organizations_names_list_by_organizations_ids(
211
- organizations_ids_list=[update_status_and_information_dict.get("organization_id") for
212
- update_status_and_information_dict in update_status_and_information_list])
213
+ organizations_ids_list = []
214
+ for update_status_and_information in update_status_and_information_list:
215
+ organization_id = update_status_and_information.get("organization_id")
216
+ if organization_id is not None:
217
+ organizations_ids_list.append(organization_id)
218
+
219
+ organizations_ids_and_names_list = self.get_organizations_ids_and_names_list_by_organizations_ids(
220
+ organizations_ids_list=organizations_ids_list,
221
+ view_table_name="organization_ml_view")
222
+
223
+ # Convert organizations_ids_and_names_list to a dictionary
224
+ organizations_ids_and_names_dict = {item["organization_id"]: item["title"] for item in organizations_ids_and_names_list}
225
+
226
+ for update_status_and_information in update_status_and_information_list:
227
+ organization_id = update_status_and_information.get("organization_id")
228
+ if organization_id is not None:
229
+ update_status_and_information["organization_name"] = organizations_ids_and_names_dict.get(organization_id)
213
230
 
214
231
  return update_status_and_information_list
215
232
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: organizations-local
3
- Version: 0.0.29
3
+ Version: 0.0.31
4
4
  Summary: PyPI Package for Circles organizations-local Python
5
5
  Home-page: https://github.com/circles-zone/organizations-local-python-package
6
6
  Author: Circles
@@ -6,7 +6,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
6
6
 
7
7
  setuptools.setup(
8
8
  name=PACKAGE_NAME,
9
- version='0.0.29', # https://pypi.org/project/organizations-local/
9
+ version='0.0.31', # https://pypi.org/project/organizations-local/
10
10
  author="Circles",
11
11
  author_email="info@circlez.ai",
12
12
  description="PyPI Package for Circles organizations-local Python",