diff --git a/child_compassion/models/child_compassion.py b/child_compassion/models/child_compassion.py index ff4da5dd2..74cb037d5 100644 --- a/child_compassion/models/child_compassion.py +++ b/child_compassion/models/child_compassion.py @@ -447,10 +447,6 @@ def unlink(self): holds.release_hold() return res - def unlink_job(self): - """Small wrapper to unlink only released children.""" - return self.filtered(lambda c: c.state == "R").unlink() - ########################################################################## # PUBLIC METHODS # ########################################################################## @@ -701,17 +697,6 @@ def child_released(self, state="R"): to_release.write({"sponsor_id": False, "state": state, "hold_id": False}) # Check if it was a depart and retrieve lifecycle event to_release.get_lifecycle_event() - - # the children will be deleted when we reach their expiration date - postpone = 60 * 60 * 24 * 7 # One week by default - today = datetime.today() - for child in to_release.filtered(lambda c: not c.has_been_sponsored): - if child.hold_expiration: - expire = child.hold_expiration - postpone = (expire - today).total_seconds() + 60 - - child.with_delay(eta=postpone).unlink_job() - return True def child_departed(self): diff --git a/child_compassion/models/child_lifecycle_event.py b/child_compassion/models/child_lifecycle_event.py index 6d014ab58..6fde5aa65 100644 --- a/child_compassion/models/child_lifecycle_event.py +++ b/child_compassion/models/child_lifecycle_event.py @@ -274,6 +274,8 @@ class ChildLifecycleEvent(models.Model): [ ("Abuse", "Abuse"), ("Fatal Accident or Suicide", "Fatal Accident or Suicide"), + ("Fatal Accident", "Fatal Accident"), + ("Suicide", "Suicide"), ("Gastro-Intestinal", "Gastro-Intestinal"), ("Infection", "Infection"), ("Maternal", "Maternal"), @@ -299,7 +301,7 @@ class ChildLifecycleEvent(models.Model): ("Chicken Pox", "Chicken Pox"), ("Chikungunya", "Chikungunya"), ("Cholera", "Cholera"), - ("Congenital Abnormalities", "Congenital Abnormalities"), + ("Congenital Abnormalitie s", "Congenital Abnormalities"), ("Dengue", "Dengue"), ("Diabetes", "Diabetes"), ("Diarrhea", "Diarrhea"),