diff options
| author | Charlie Denton <charleswdenton@gmail.com> | 2016-06-13 13:09:54 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-06-13 08:09:54 -0400 |
| commit | f2c0eb19e961f5864573251e70bdcdecd0250aed (patch) | |
| tree | fd6aaa4878bebe72b1a56f2fdbc1fda9474a6b5b /django | |
| parent | 57eb17b8c7d106c9a3264aa35b8dabb179a1e17b (diff) | |
Fixed #26748 -- Allowed overriding JSONField's widget with an attribute.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/postgres/forms/jsonb.py | 5 |
1 files changed, 1 insertions, 4 deletions
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: |
