Skip to content

Commit

Permalink
Merge pull request #184 from Georiviere/fix_contribution_map
Browse files Browse the repository at this point in the history
🐛 Fix contributions search fields / maplayer serilaizer
  • Loading branch information
LePetitTim committed Jun 8, 2023
2 parents 81848de + 5495a5d commit 7df4c13
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions georiviere/portal/serializers/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class Meta:

def get_is_searchable(self, obj):
if obj.layer_type.split('-')[0] in ['pois', 'streams', 'contributions', 'sensitivities']:
return False
return True
return True
return False

def get_options(self, obj):
return {'style': obj.style if obj.style else None}
Expand Down
3 changes: 2 additions & 1 deletion georiviere/portal/views/contribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class ContributionViewSet(mixins.CreateModelMixin, mixins.RetrieveModelMixin, mi
pagination_class = LimitOffsetPagination
renderer_classes = [CamelCaseJSONRenderer, GeoJSONRenderer, ]
filter_backends = [filters.OrderingFilter, filters.SearchFilter]
search_fields = ['category', 'category__type']
search_fields = ['potential_damage__type', 'fauna_flora__type', 'quality__type', 'quantity__type',
'landscape_element__type']

@action(detail=False, url_name="json_schema", methods=['get'],
renderer_classes=[renderers.JSONRenderer],
Expand Down

0 comments on commit 7df4c13

Please sign in to comment.