diff --git a/child_compassion/models/compassion_hold.py b/child_compassion/models/compassion_hold.py index 79b27c82c..efbb1d702 100644 --- a/child_compassion/models/compassion_hold.py +++ b/child_compassion/models/compassion_hold.py @@ -486,24 +486,28 @@ def postpone_no_money_hold(self, additional_text=None): } hold.write(hold_vals) - body = ( - "The no money hold for child {local_id} was expiring on " - "{old_expiration} and was extended to {new_expiration} " - "({extension_description} extension).{additional_text}" - ) - hold.message_post( - body=_(body.format(**values)), - subject=_("No money hold extension"), - subtype_xmlid="mail.mt_comment", - ) - - else: - body = _( - "The no money hold for child {local_id} is expiring on " - "{old_expiration} and will not be extended since " - "no sponsorship exists for this child." - ) - hold.message_post(body=body.format(**values)) + # ---------------------------------------------------- + # NOTIFICATION (Only for NO_MONEY_HOLD) + # ---------------------------------------------------- + if hold.type == HoldType.NO_MONEY_HOLD.value: + if hold.child_id.sponsor_id: + body = ( + "The no money hold for child {local_id} was expiring on " + "{old_expiration} and was extended to {new_expiration} " + "({extension_description} extension).{additional_text}" + ) + hold.message_post( + body=_(body.format(**values)), + subject=_("No money hold extension"), + subtype_xmlid="mail.mt_comment", + ) + else: + body = _( + "The no money hold for child {local_id} is expiring on " + "{old_expiration} and will not be extended since " + "no sponsorship exists for this child." + ) + hold.message_post(body=body.format(**values)) ########################################################################## # Mapping METHOD #