Thursday, April 17, 2008

How to make members accept terms of use

As done on Plone 2.5:
On your member content type, which should be a remember sterotype, add this field.
The validator does all the work.
You have will have to import ExpressionValidator.

atapi.BooleanField(
name='acceptTerms',
required=1,
regfield=1,
validators = ( ExpressionValidator('python: (value == 1) or (value ==\'1\') or (value == True)', 'You must accept the terms in order to become a member.'), ),
widget=atapi.BooleanWidget(
label="Accept terms of use",
description="By clicking this box, you acknowledge that you have read and understood the terms of use, and will use your account in compliance with these terms.",

No comments: