From 19080924d521633057558c4d3b56f60622d5fb4e Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 19 Feb 2019 20:14:10 -0600 Subject: [PATCH] Declare "is contact" for the Customers view removes some duplicated code. also this adds CustomerNote to version history --- tailbone/views/customers.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tailbone/views/customers.py b/tailbone/views/customers.py index e25018e4..b3607fbf 100644 --- a/tailbone/views/customers.py +++ b/tailbone/views/customers.py @@ -49,6 +49,7 @@ class CustomersView(MasterView): Master view for the Customer class. """ model_class = model.Customer + is_contact = True has_versions = True supports_mobile = True people_detachable = True @@ -252,13 +253,6 @@ class CustomersView(MasterView): if query.count(): raise colander.Invalid(node, "Customer ID must be unique") - def objectify(self, form, data=None): - if data is None: - data = form.validated - customer = super(CustomersView, self).objectify(form, data) - customer = self.objectify_contact(customer, data) - return customer - def render_default_email(self, customer, field): if customer.emails: return customer.emails[0].address @@ -346,6 +340,7 @@ class CustomersView(MasterView): (model.CustomerEmailAddress, 'parent_uuid'), (model.CustomerMailingAddress, 'parent_uuid'), (model.CustomerPerson, 'customer_uuid'), + (model.CustomerNote, 'parent_uuid'), ] def detach_person(self):