Skip to content

Commit

Permalink
Disable numeric fields from feature search. Fixes #4062
Browse files Browse the repository at this point in the history
  • Loading branch information
capooti committed Nov 8, 2018
1 parent a1bf0ac commit d185e6a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions geonode/contrib/worldmap/wm_extra/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1094,20 +1094,20 @@ def layer_searchable_fields(
status_message = ''
for attribute in layer.attributes:
ext_att, created = ExtLayerAttribute.objects.get_or_create(attribute=attribute)
if attribute.attribute in attributes_list:
ext_att.searchable = False
if attribute.attribute in attributes_list and attribute.attribute_type == 'xsd:string':
ext_att.searchable = True
status_message += ' %s' % attribute.attribute
else:
ext_att.searchable = False
ext_att.save()

searchable_attributes = []
for attribute in layer.attributes:
if hasattr(attribute, 'extlayerattribute'):
attribute.searchable = attribute.extlayerattribute.searchable
else:
attribute.searchable = False
searchable_attributes.append(attribute)
if attribute.attribute_type == 'xsd:string':
if hasattr(attribute, 'extlayerattribute'):
attribute.searchable = attribute.extlayerattribute.searchable
else:
attribute.searchable = False
searchable_attributes.append(attribute)

template = 'wm_extra/layers/edit_searchable_fields.html'

Expand Down

0 comments on commit d185e6a

Please sign in to comment.