Update error in frappe.get_single('Domain Settings').save()

You need to check for defaults and deleted docs …

have a look at: