Skip to content

Commit

Permalink
🐛 Fix serializer portal map
Browse files Browse the repository at this point in the history
  • Loading branch information
LePetitTim committed Jul 20, 2023
1 parent a02cfe7 commit ae2813b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ CHANGELOG
* Add flatpages module
* Add valorization POIs
* Add sensitivity module
* Add public portals on watershed types allowing to publish them

**Bug fixes**

Expand Down
4 changes: 2 additions & 2 deletions georiviere/portal/serializers/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_geojson_url(self, obj):
layer_type = obj.layer_type.split('-')
# TODO: Make lang dynamic
reverse_kwargs = {'lang': 'fr', 'format': 'geojson'}
if layer_type[0] in ['waterhseds', 'pois', 'streams', 'contributions']:
if layer_type[0] in ['watersheds', 'pois', 'streams', 'contributions']:
reverse_kwargs['portal_pk'] = obj.portal.pk
if len(layer_type) == 2:
filter_type = layer_type[-1]
Expand All @@ -58,7 +58,7 @@ def get_url(self, obj):
return None
# TODO: Make lang dynamic
reverse_kwargs = {'lang': 'fr'}
if layer_type[0] in ['waterhseds', 'pois', 'streams', 'contributions']:
if layer_type[0] in ['watersheds', 'pois', 'streams', 'contributions']:
reverse_kwargs['portal_pk'] = obj.portal.pk
return reverse(f'api_portal:{layer_type[0]}-list', kwargs=reverse_kwargs)

Expand Down

0 comments on commit ae2813b

Please sign in to comment.