Skip to content

Commit

Permalink
consider default_style.name if set (#7394)
Browse files Browse the repository at this point in the history
Co-authored-by: Giovanni Allegri <giohappy@gmail.com>
(cherry picked from commit 5c5f068)
  • Loading branch information
marthamareal authored and afabiani committed Apr 27, 2021
1 parent 2b9c0f6 commit 4d989a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions geonode/maps/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ def get_legend(self):
layer_obj = Layer.objects.filter(alternate=self.name).first()
if ':' in style_name:
style_name = style_name.split(':')[1]
elif layer_obj.default_style:
style_name = layer_obj.default_style.name
href = layer_obj.get_legend_url(style_name=style_name)
return {style_name: href}
except Exception as e:
Expand Down

0 comments on commit 4d989a2

Please sign in to comment.