Skip to content

Commit

Permalink
Update discovery.py
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper authored Feb 4, 2025
1 parent a0abb9f commit 0dfb877
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wis2box-management/wis2box/metadata/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ def generate(self, mcf: dict) -> str:
if record['properties']['contacts'][0].get('organization') is None:
record['properties']['contacts'][0]['organization'] = record['properties']['contacts'][0].pop('name', "NOTSET") # noqa

if 'language' in record['properties']:
_ = record['properties'].pop('language')

try:
phone = record['properties']['contacts'][0]['phones'][0]['value']
if isinstance(phone, int):
Expand Down Expand Up @@ -253,6 +250,9 @@ def publish_discovery_metadata(metadata: Union[dict, str]):
record_mcf = dm.parse_record(metadata)
record = dm.generate(record_mcf)

if 'language' in record['properties']:
_ = record['properties'].pop('language')

distribution_links = dm.get_distribution_links(record, format_='wcmp2')
# update links, do not extend or we get duplicates
record['links'] = distribution_links
Expand Down

0 comments on commit 0dfb877

Please sign in to comment.