Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xianbu committed Feb 3, 2018
1 parent a863795 commit f4cbdd7
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions sutradata/lib/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from django.conf import settings
from django.db import models

from social_core.utils import setting_name

try:
from django.utils.encoding import smart_unicode as smart_text
smart_text # placate pyflakes
Expand All @@ -26,10 +24,7 @@

field_class = functools.partial(six.with_metaclass, field_metaclass)

if getattr(settings, setting_name('POSTGRES_JSONFIELD'), False):
from django.contrib.postgres.fields import JSONField as JSONFieldBase
else:
JSONFieldBase = field_class(models.TextField)
from django.contrib.postgres.fields import JSONField as JSONFieldBase


class JSONField(JSONFieldBase):
Expand Down Expand Up @@ -91,4 +86,3 @@ def value_from_object(self, obj):
"""Return value dumped to string."""
orig_val = super(JSONField, self).value_from_object(obj)
return self.get_prep_value(orig_val)

0 comments on commit f4cbdd7

Please sign in to comment.