summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2014-10-09 12:18:26 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2014-10-09 12:18:26 (GMT)
commit60fd76214b2d6c6baa44415838ab144e925ef11f (patch)
treec0c9f7be62de26b54e3ad0b123780ad1b7e63792
parent3be89e44b0afe06d84efc914cb529b21b0aad1f9 (diff)
downloadcollective.contact.widget-master.zip
collective.contact.widget-master.tar.gz
collective.contact.widget-master.tar.bz2
make it possible to restrict a contact choice to persons (#4631)HEADmaster
-rw-r--r--src/collective/contact/widget/schema.py4
1 files 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)