Skip to content
Snippets Groups Projects
Commit 4d19cf63 authored by Valentin Rigal's avatar Valentin Rigal
Browse files

Compare lowercase structural metadata

parent c34f8d1b
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ class ElementSearch(SearchAPIView):
if structural_metadata:
search = search.filter(
'wildcard',
structural_metadata='*{}*'.format(structural_metadata)
structural_metadata='*{}*'.format(structural_metadata.lower())
)
if element_type:
......
......@@ -139,7 +139,7 @@ class ESElement(Document):
for element in Element.objects.get_ascending(instance.id)
],
structural_metadata=[
md.value
md.value.lower()
for md in instance.metadatas.filter(type=MetaType.Structural)
],
transcriptions=list(map(
......
......@@ -42,4 +42,4 @@ class TestESDocuments(FixtureAPITestCase):
element = self.corpus.elements.get(name='Volume 1')
element.metadatas.create(type=MetaType.Structural, name='ref.', value='123ABC')
es_document = ESElement.from_model(element)
self.assertCountEqual(es_document.structural_metadata, ['123ABC'])
self.assertCountEqual(es_document.structural_metadata, ['123abc'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment