From b1fd0ac2392ae8cb2780e6b51dfe1b9bef8ff1ec Mon Sep 17 00:00:00 2001
From: Olexander Yermakov <mannavard1611@gmail.com>
Date: Tue, 26 Jul 2016 14:14:36 +0300
Subject: [PATCH] Fix disabled forms.JSONField crash with TypeError
---
django/contrib/postgres/forms/jsonb.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/django/contrib/postgres/forms/jsonb.py b/django/contrib/postgres/forms/jsonb.py
index 415288d..609112c 100644
a
|
b
|
class JSONField(forms.CharField):
|
21 | 21 | super(JSONField, self).__init__(**kwargs) |
22 | 22 | |
23 | 23 | def to_python(self, value): |
| 24 | if self.disabled: |
| 25 | return value |
| 26 | |
24 | 27 | if value in self.empty_values: |
25 | 28 | return None |
26 | 29 | try: |