From 60fd76214b2d6c6baa44415838ab144e925ef11f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Thu, 9 Oct 2014 14:18:26 +0200 Subject: [PATCH] make it possible to restrict a contact choice to persons (#4631) --- src/collective/contact/widget/schema.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/collective/contact/widget/schema.py b/src/collective/contact/widget/schema.py index d712f73..1c8425d 100644 --- a/src/collective/contact/widget/schema.py +++ b/src/collective/contact/widget/schema.py @@ -20,7 +20,7 @@ class ContactChoice(RelationChoice): def __init__(self, *args, **kwargs): self.addlink = kwargs.pop('addlink', True) + portal_types = kwargs.pop('portal_types', ('organization', 'person', 'held_position')) if not ('values' in kwargs or 'vocabulary' in kwargs or 'source' in kwargs): - kwargs['source'] = ContactSourceBinder( - portal_type=('organization', 'person', 'held_position')) + kwargs['source'] = ContactSourceBinder(portal_type=portal_types) super(ContactChoice, self).__init__(*args, **kwargs)