Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

### Removed

## [1.4.1]

### Changed

- Modified so that the BDS only pulls reporting orgs marked as discoverable on
the Registry.

## [1.4.0]

### Added
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "bulk-data-service"
version = "1.4.0"
version = "1.4.1"
requires-python = ">= 3.12.6"
readme = "README.md"
dependencies = [
Expand Down
9 changes: 5 additions & 4 deletions src/dataset_registration/iati_registry_suitecrm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import uuid
from datetime import datetime

from libsuitecrm import SuiteCRM # type: ignore
from libsuitecrm import Filter, SuiteCRM # type: ignore

from bulk_data_service.data_validators import (
validate_suitecrm_record_structure,
Expand Down Expand Up @@ -52,8 +52,8 @@ def fetch_datasets_metadata(
if owning_org is None:
context.logger.error(
f"SuiteCRM dataset id: {record['id']} has reporting org id: "
f"{record['attributes'].get('iati_dataset_owner_org_id', '')} but there is no such reporting org. "
"Skipping."
f"{record['attributes'].get('iati_dataset_owner_org_id', '')} but that reporting org does not exist "
"or is not discoverable. Skipping."
)
continue

Expand All @@ -72,7 +72,8 @@ def fetch_reporting_orgs_metadata(context: BDSContext, refresh_timestamp: dateti

context.logger.info("Fetching all reporting orgs using the libsuitecrm library...")

suitecrm_reporting_org_records = [r for r in crm.get_all_records("Accounts")]
filters = Filter().equal("iati_registry_discoverable", "1")
suitecrm_reporting_org_records = [r for r in crm.get_all_records("Accounts", filters=filters)]

crm.logout()

Expand Down