Commit 8be2f92f authored by edpibu's avatar edpibu 🚵🏻

Update filters.py for multiple groups

parent e0809689
......@@ -27,16 +27,17 @@ def filter_group(event, selected_groups) -> bool:
summary_search = re.search('([0-9]{3}) - ([A-Z]{2}) \(grpe : ([^\)]*)\)', summary, re.IGNORECASE)
if summary_search:
ue, group = 'ue_' + summary_search.group(1), summary_search.group(3)
ue, groups = 'ue_' + summary_search.group(1), summary_search.group(3).split(' - ')
if ue in selected_groups:
# UE is configured
if group in selected_groups[ue]:
# Group was selected
return True
else:
# Group is not the one selected
logger.info('Removed {} because it had not been chosen'.format(summary))
return False
for group in groups:
if group in selected_groups[ue]:
# Group was selected
return True
# Group is not the one selected
logger.info('Removed {} because it had not been chosen'.format(summary))
return False
# If there is not a group specified do not filter
return True
Markdown is supported
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