From adda188bedd91cf51ad55cf84b18d98bc0b1b25e Mon Sep 17 00:00:00 2001 From: meichthys Date: Mon, 22 Sep 2025 03:53:54 +0000 Subject: [PATCH] fix error when creating new person without spouse --- church/church/doctype/church_person/church_person.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/church/church/doctype/church_person/church_person.py b/church/church/doctype/church_person/church_person.py index a0256d3..cd30ba5 100644 --- a/church/church/doctype/church_person/church_person.py +++ b/church/church/doctype/church_person/church_person.py @@ -46,7 +46,7 @@ class ChurchPerson(Document): f"{self.full_name} 👩‍❤️‍👨 {spouse.full_name}" ) else: - if self._doc_before_save.spouse: + if self._doc_before_save and self._doc_before_save.spouse: spouse = frappe.get_doc("Church Person", self._doc_before_save.spouse) frappe.db.set_value("Church Person", spouse.name, "is_married", False) frappe.db.set_value("Church Person", spouse.name, "spouse", None)