Skip to content

Commit

Permalink
Merge pull request #27 from eea/develop
Browse files Browse the repository at this point in the history
Release: Fix data_provenance indexer
  • Loading branch information
avoinea authored Oct 16, 2023
2 parents 93f8e10 + 5993b85 commit ef2af8a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
9 changes: 7 additions & 2 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
Changelog
=========

3.4 - (2023-10-16)
---------------------------
* Fix: Fix data_provenance indexer
[avoinea - refs #258077]

3.3 - (2023-10-16)
---------------------------
* Change: Release
[avoinea]
* Feature: Add data_provenance indexer
[dobri1408 - refs #258077]

3.2 - (2023-07-19)
---------------------------
Expand Down
11 changes: 6 additions & 5 deletions eea/coremetadata/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ def temporal_coverage_indexer(obj):
def data_provenance_indexer(obj):
"""Data Provenance indexer"""

data_provenance = getattr(obj, "data_provenance", None)
if not data_provenance or "data" not in obj.data_provenance:
data_provenance = getattr(obj, "data_provenance", {})
if not data_provenance or "data" not in data_provenance:
return None

data = {}
for val in obj.data_provenance['data']:
data[val["organisation"]] = val["organisation"]

for val in data_provenance.get('data', []):
organisation = val.get("organisation", "")
if organisation:
data[organisation] = organisation
return data
2 changes: 1 addition & 1 deletion eea/coremetadata/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3
3.4

0 comments on commit ef2af8a

Please sign in to comment.