From f2c0eb19e961f5864573251e70bdcdecd0250aed Mon Sep 17 00:00:00 2001 From: Charlie Denton Date: Mon, 13 Jun 2016 13:09:54 +0100 Subject: Fixed #26748 -- Allowed overriding JSONField's widget with an attribute. --- django/contrib/postgres/forms/jsonb.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'django/contrib/postgres/forms') diff --git a/django/contrib/postgres/forms/jsonb.py b/django/contrib/postgres/forms/jsonb.py index 415288dc90..bd1f175e4b 100644 --- a/django/contrib/postgres/forms/jsonb.py +++ b/django/contrib/postgres/forms/jsonb.py @@ -15,10 +15,7 @@ class JSONField(forms.CharField): default_error_messages = { 'invalid': _("'%(value)s' value must be valid JSON."), } - - def __init__(self, **kwargs): - kwargs.setdefault('widget', forms.Textarea) - super(JSONField, self).__init__(**kwargs) + widget = forms.Textarea def to_python(self, value): if value in self.empty_values: -- cgit v1.3