Skip to content

Commit

Permalink
🐛 Fix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
usbtypec1 committed Aug 4, 2024
1 parent 18fecaa commit 30f0729
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/context/employee_birthdays.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ def filter_employee_birthdays_by_full_name(
employee_birthdays: Iterable[EmployeeBirthday],
employees_blacklist: Iterable[str],
) -> list[EmployeeBirthday]:
employees_blacklist = set(employees_blacklist)
employees_blacklist = {name.lower() for name in employees_blacklist}

result: list[EmployeeBirthday] = []

for employee_birthday in employee_birthdays:
for employee_in_blacklist in employees_blacklist:
if employee_birthday.full_name in employee_in_blacklist.lower():
result.append(employee_birthday)
if employee_in_blacklist in employee_birthday.full_name.lower():
break
else:
result.append(employee_birthday)

return result

Expand Down

0 comments on commit 30f0729

Please sign in to comment.