From a6d97538aff3786400e0d1d4f5ef5bd83b57c027 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Fri, 11 Feb 2022 19:15:39 -0600 Subject: [PATCH] Use new-style config defaults for customer views --- tailbone/views/customers.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tailbone/views/customers.py b/tailbone/views/customers.py index b4dd77c6..310bddb5 100644 --- a/tailbone/views/customers.py +++ b/tailbone/views/customers.py @@ -614,12 +614,23 @@ def customer_info(request): } -def includeme(config): +def defaults(config, **kwargs): + base = globals() - # info + # TODO: deprecate / remove this config.add_route('customer.info', '/customers/info') + customer_info = kwargs.get('customer_info', base['customer_info']) config.add_view(customer_info, route_name='customer.info', renderer='json', permission='customers.view') + CustomerView = kwargs.get('CustomerView', + base['CustomerView']) CustomerView.defaults(config) + + PendingCustomerView = kwargs.get('PendingCustomerView', + base['PendingCustomerView']) PendingCustomerView.defaults(config) + + +def includeme(config): + defaults(config)