Skip to content

Commit

Permalink
Fix fetching categories case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Orzu Tursunova committed Jun 12, 2024
1 parent 03112c4 commit 0039ead
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@
// Update checked tags via event
document.addEventListener("{{table_id}}-update-tag", ({detail}) => {
const filterTag = $("#{{ table_id }}-tags-filter input[type=checkbox]").filter(function() {
console.log( $(this).attr('value'), detail.tagVal );
return $(this).attr('value') === detail.tagVal;
return $(this).attr('value').toLowerCase() === detail.tagVal.toLowerCase();
})
filterTag.prop('checked', true);
search();
Expand Down
2 changes: 1 addition & 1 deletion src/pkg/caendr/caendr/api/phenotype.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def get_trait_categories(query = None):
tags = filter(None, ( tr.get_tags() for tr in query ))

# Flatten the list of lists into a set, and sort the result
tags_list = { tg for tr_tag in tags for tg in tr_tag }
tags_list = { tg.title() for tr_tag in tags for tg in tr_tag }
return sorted(tags_list)


Expand Down
2 changes: 1 addition & 1 deletion src/pkg/caendr/caendr/models/sql/phenotype_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_tags(self):
If no tag set defined, returns None.
'''
if self.tags:
return { tg.strip() for tg in self.tags.split(',') }
return { tg.strip().lower() for tg in self.tags.split(',') }


def add(self, trait_obj):
Expand Down

0 comments on commit 0039ead

Please sign in to comment.