def clean(self):
        """ Validates the form. """
        if self.cleaned_data.get('poll_question', None) \
                and not self.cleaned_data.get('poll_max_options', None):
            self.add_error(
                'poll_max_options',
                _('You must set the maximum number of poll options per user when creating polls'),
            )

        super().clean()
def clean ( self ) : if self . cleaned_data . get ( 'poll_question' , None ) and not self . cleaned_data . get ( 'poll_max_options' , None ) : self . add_error ( 'poll_max_options' , _ ( 'You must set the maximum number of poll options per user when creating polls' ) , ) super ( ) . clean ( )
Validates the form.