From 5d31d922ee4245d2519e80c1135fadeb4f279581 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Thu, 13 May 2010 12:56:16 +0100 Subject: [PATCH] Fixed a few issues with setting storage --- sso/models.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sso/models.py b/sso/models.py index 1d5dff0..39a5a13 100644 --- a/sso/models.py +++ b/sso/models.py @@ -1,10 +1,13 @@ import re import unicodedata import logging +import types from django.db import models from django.db.models import signals from django.contrib.auth.models import User, UserManager, Group +from django.utils import simplejson as json + from django_jsonfield.fields import JSONField from eve_api.models import EVEAccount, EVEPlayerCorporation, EVEPlayerAlliance from reddit.models import RedditAccount @@ -144,6 +147,9 @@ class Service(models.Model): self.settings_json = self.settings else: self.settings_json = {} + else: + if isinstance(self.settings_json, types.StringTypes): + self.settings_json = eval(self.settings_json) return models.Model.save(self)