From 4a9b528c4762fe8a7c55f6703a78e41a54de1c34 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Wed, 6 Mar 2019 21:06:48 -0600 Subject: [PATCH] Only objectify address data if present i.e. don't try to "remove" an address if no fields are present in form --- tailbone/views/master.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tailbone/views/master.py b/tailbone/views/master.py index 97b5063c..12e5fe74 100644 --- a/tailbone/views/master.py +++ b/tailbone/views/master.py @@ -2752,7 +2752,7 @@ class MasterView(View): else: contact.add_mailing_address(**addr) - elif contact.addresses: + elif any([field in data for field in address_fields]) and contact.addresses: contact.addresses.pop() return contact