From d5d7516ffef508fd96abd3bc6567ad5eb25c025f Mon Sep 17 00:00:00 2001 From: meichthys Date: Fri, 13 Feb 2026 03:53:32 +0000 Subject: [PATCH] Fix person creation without family --- church/church_people/doctype/church_person/church_person.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/church/church_people/doctype/church_person/church_person.py b/church/church_people/doctype/church_person/church_person.py index 45ea7d3..fb33a13 100644 --- a/church/church_people/doctype/church_person/church_person.py +++ b/church/church_people/doctype/church_person/church_person.py @@ -20,6 +20,10 @@ class ChurchPerson(Document): if not found: family.append("members", {"member": self.name}) family.save() + + # Return if person doesn't have family + if not self.family and not self.get_doc_before_save().family: + return # Remove person from Church Family if family is removed if not self.family and self.get_doc_before_save().family is not None: family = frappe.get_doc("Church Family", self.get_doc_before_save().family)