Exemplo n.º 1
0
 def clean(self):
     """
     sanitize user input so there isn't any HTML... issue117
     """
     f_comments = self.cleaned_data.get('user_comments')      
     self.cleaned_data['user_comments'] = utils.sanitize_html(f_comments)
     f_selection = self.cleaned_data.get('selected_text')
     self.cleaned_data['selected_text'] = utils.sanitize_html(f_selection)
     return self.cleaned_data
Exemplo n.º 2
0
 def clean(self):
     """
     make sure we aren't accepting HTML input
     """
     f_value = self.cleaned_data.get('text')
     logger.info("core.forms.CommentSubmitForm(): checking input f_value=%s,"\
         , f_value)
     if f_value == None or f_value.strip() == '':
         logger.error("core.forms.CommentSubmitForm(): comment was empty")
         raise forms.ValidationError('Empty form')
     self.cleaned_data['text'] = utils.sanitize_html(f_value)
     return self.cleaned_data