mirror of
https://github.com/meichthys/church.git
synced 2026-02-12 11:33:43 +00:00
fix error when creating new person without spouse
This commit is contained in:
parent
ae2c123c79
commit
adda188bed
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user