oslokommune / devportal-harvest-poc

0 stars 0 forks source link

API aggregator doesn't add items, it overwrites them #19

Open yngvark opened 4 years ago

yngvark commented 4 years ago

https://github.com/oslokommune/devportal-harvest-poc/blob/master/tools/aggregator/aggregator.py#L36

result = { level: list() for level in Visibility }

for item in data:
        result[Visibility(item.visibility)] = item.serialize()

should be

result = { level: list() for level in Visibility }

for item in data:
        result[Visibility(item.visibility)].append(item.serialize())

If not, the lists made in the first line will be overwritten by the serialized content.

deifyed commented 4 years ago

Yikes :embarrased_face: