Skip to content

Commit

Permalink
Initialize with elements
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanReiter committed Jun 22, 2011
1 parent 1644727 commit db080fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion safehtmlform/fields.py
Expand Up @@ -3,14 +3,14 @@
from django.utils.translation import ugettext as _

class SafeHTMLField(forms.CharField):
help_text=_("This field allows the use of the following HTML tags: %(tags)s." % {'tags': acceptable_elements})
widget=forms.widgets.Textarea()

def __init__(self, *args, **kwargs):
self.acceptable_elements = acceptable_elements
additional_elements = kwargs.pop("additional_elements", None)
if additional_elements:
self.acceptable_elements += additional_elements
self.help_text=_("This field allows the use of the following HTML tags: %(tags)s." % {'tags': self.acceptable_elements})
super(SafeHTMLField, self).__init__(*args, **kwargs)

def clean(self, value):
Expand Down

0 comments on commit db080fd

Please sign in to comment.