Commit a152fc54 authored by Mikaël Salson's avatar Mikaël Salson Committed by Vidjil Team
Browse files

vidjil_utils: make comment and parameter name reflects the change in the type of parameter

parent 3d24d187
......@@ -121,18 +121,18 @@ def anon_names(patient_id, first_name, last_name, can_view=None):
return name
# take a string to check and a filter_str (list of word to find (or not))
# take a list of strings to check and a filter_str (list of word to find (or not))
# return true if the string respect the filter list
def advanced_filter(str, filter_str):
def advanced_filter(list_searched, filter_str):
filter_list = filter_str.split(" ")
str = map(lambda s: s.lower(), str)
list_searched = map(lambda s: s.lower(), list_searched)
for f in filter_list :
if len(f) > 0 and f[0] == "-" :
pattern = f[1:]
else:
pattern = f
result = filter(lambda item: pattern.lower() in item, str)
result = filter(lambda item: pattern.lower() in item, list_searched)
if len(result) == 0:
return False
return True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment