def __init__(self, *args, **kwargs): super(WikiSnipForm, self).__init__(*args, **kwargs) self.fields['body'].widget.attrs['cols'] = 80 self.fields['body'].widget.attrs['rows'] = 30 if not sphutils.has_captcha_support() or get_current_user( ).is_authenticated(): del self.fields['captcha']
def __init__(self, *args, **kwargs): super(PostForm, self).__init__(*args, **kwargs) if not sphutils.has_captcha_support() or get_current_user( ).is_authenticated(): del self.fields['captcha'] if len(POST_MARKUP_CHOICES) == 1: del self.fields['markup']
def __init__(self, *args, **kwargs): super(CaptchaEditBaseForm, self).__init__(*args, **kwargs) if sphutils.has_captcha_support() and not get_current_user().is_authenticated(): self.fields['captcha'] = sphutils.CaptchaField(widget=sphutils.CaptchaWidget, help_text = ugettext('Please enter the result of the above calculation.'), ) self.fields['tags'] = TagField(model = WikiSnip, required = False)
def __init__(self, *args, **kwargs): super(CaptchaEditBaseForm, self).__init__(*args, **kwargs) if sphutils.has_captcha_support() and not get_current_user().is_authenticated: self.fields['captcha'] = sphutils.CaptchaField(widget=sphutils.CaptchaWidget, help_text=ugettext( 'Please enter the result of the above calculation.'), ) self.fields['tags'] = TagField(model=WikiSnip, required=False)
def __init__(self, *args, **kwargs): super(PostForm, self).__init__(*args, **kwargs) if not sphutils.has_captcha_support() or get_current_user().is_authenticated(): del self.fields['captcha'] if len( POST_MARKUP_CHOICES ) == 1: del self.fields['markup']
def __init__(self, *args, **kwargs): super(RegisterEmailAddress, self).__init__(*args, **kwargs) if not sphutils.has_captcha_support() or not sphsettings.get_sph_setting('community_register_require_captcha', False): del self.fields['captcha']
def __init__(self, *args, **kwargs): super(RegisterEmailAddress, self).__init__(*args, **kwargs) if not sphutils.has_captcha_support( ) or not sphsettings.get_sph_setting( 'community_register_require_captcha', False): del self.fields['captcha']
def __init__(self, *args, **kwargs): super(WikiSnipForm, self).__init__(*args, **kwargs) self.fields['body'].widget.attrs['cols'] = 80; self.fields['body'].widget.attrs['rows'] = 30; if not sphutils.has_captcha_support() or get_current_user().is_authenticated(): del self.fields['captcha']