Skip to content

Commit

Permalink
safeguard WCMP2 organization (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Nov 22, 2023
1 parent 2dc64a5 commit 3726498
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wis2box-management/wis2box/metadata/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ def generate(self, mcf: dict) -> str:
LOGGER.debug('Generating OARec discovery metadata')
record = WMOWCMP2OutputSchema().write(md, stringify=False)
record['properties']['wmo:topicHierarchy'] = mqtt_topic
record['properties']['contacts'][0]['organization'] = record['properties']['contacts'][0].pop('name') # noqa

if record['properties']['contacts'][0].get('organization') is None:
record['properties']['contacts'][0]['organization'] = record['properties']['contacts'][0].pop('name', "NOTSET") # noqa

try:
phone = record['properties']['contacts'][0]['phones'][0]['value']
Expand Down

0 comments on commit 3726498

Please sign in to comment.