Skip to content

Commit

Permalink
display also simple source types
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Jun 7, 2024
1 parent a685e56 commit 5d0080b
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions metadata_catalogue/maps/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,16 @@ def get_metadata(self, request):
},
}

if source and source.type:
lazy_layers[layer.slug]["source"] = {
"type": source.type,
"url": source.get_source_url(request),
}
if source:
lazy_layers[layer.slug]["source"] = {}
s = lazy_layers[layer.slug]["source"]
if source.type:
s["url"] = source.get_source_url(request)
s["type"] = source.type

if source.extra and len(source.extra):
lazy_layers[layer.slug]["source"] = {**s, **source.extra}

if source.attribution is not None:
lazy_layers[layer.slug]["attribution"] = source.attribution

Expand Down

0 comments on commit 5d0080b

Please sign in to comment.