Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions programs/programs/urgent_needs/tx/diaper_bank.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,8 @@ class NationalDiaperBankNetwork(UrgentNeedFunction):
More info: https://nationaldiaperbanknetwork.org/member-directory/
"""

dependencies = ["age", "county"]
dependencies = ["age"]
max_age = 4
eligible_counties = [
"Travis",
"Dallas",
"El Paso",
"Tarrant",
"Galveston",
"Brazoria",
"Collin",
"Bexar",
"McLennan",
]

def eligible(self) -> bool:
# Check if county is eligible
is_eligible_county = self.screen.county in self.eligible_counties
if not is_eligible_county:
return False

# age under 5
has_young_child = self.screen.num_children(age_max=self.max_age) > 0
# coerce possible None to False
has_needs_baby_supplies = bool(self.screen.needs_baby_supplies)

# Check if there are any child support expenses
has_child_support_expense = bool(self.screen.has_expense(["childSupport", "childCare"]))
return has_young_child and has_needs_baby_supplies and has_child_support_expense
return self.screen.num_children(age_max=self.max_age) > 0