collective / dexterity.membrane

enables dexterity content items to be used as users and groups in Plone sites
3 stars 14 forks source link

AttributeError: 'tuple' object has no attribute 'strip' #41

Closed b4oshany closed 5 years ago

b4oshany commented 5 years ago

Error

Module Products.PlonePAS.sheet, line 110, in setProperty
Module Products.membrane.plugins.propertymanager, line 103, in setPropertiesForUser
Module dexterity.membrane.behavior.user, line 184, in setPropertiesForUser
AttributeError: 'tuple' object has no attribute 'strip'

Cause

My userschema.xml has a tuple (iterable value):

    <field name="knowledge_base" type="zope.schema.List" marshal:primary="true" users:forms="In User Profile">
        <description></description>
        <required>False</required>
        <title>Knowledge base is used to demonstrate your knowledge, skills and any other subject area you are verse in.</title>
        <value_type type="zope.schema.Choice">
        <vocabulary>cvocabularies.knowledge_base</vocabulary>
        </value_type>
        <form:widget type="plone.app.z3cform.widget.AjaxSelectFieldWidget"/>
    </field>

The error occurs when I try to update the user info:

user.setMemberProperties(mapping=dict(knowledge_base=('Python, 'Plone')})
mauritsvanrees commented 5 years ago

I have merged your fix and released 2.1.0. Thanks!