Fix configure Tower in Tower to work with updated django-jsonfield.

This commit is contained in:
Chris Church
2016-11-15 00:22:55 -05:00
parent f5d3e1885e
commit 8dc5e7725c
7 changed files with 20 additions and 31 deletions

View File

@@ -3,7 +3,6 @@
# Python
import collections
import json
import sys
# Django
@@ -100,9 +99,6 @@ class SettingSingletonDetail(RetrieveUpdateDestroyAPIView):
if key == 'LICENSE':
continue
setattr(serializer.instance, key, value)
# Always encode "raw" strings as JSON.
if isinstance(value, basestring):
value = json.dumps(value)
setting = settings_qs.filter(key=key).order_by('pk').first()
if not setting:
setting = Setting.objects.create(key=key, user=user, value=value)