Fixed JSON being stored with single rather than double quotes.
This commit is contained in:
parent
451083cf0b
commit
f4d042f886
@ -59,7 +59,7 @@ class User(db.Model):
|
||||
self.username = data['user_information']['username']
|
||||
self.gravatar = data['user_information']['gravatar']
|
||||
if data.get('requested_information'):
|
||||
self.radicals = str(data['requested_information'])
|
||||
self.radicals = json.dumps(data['requested_information'])
|
||||
|
||||
def parse_kanji(self):
|
||||
response = requests.get("https://www.wanikani.com/api/user/" + self.api_key + "/kanji/")
|
||||
@ -68,7 +68,7 @@ class User(db.Model):
|
||||
if data.get('error'):
|
||||
raise ValueError(data['error']['message'])
|
||||
if data.get('requested_information'):
|
||||
self.kanji = str(data['requested_information'])
|
||||
self.kanji = json.dumps(data['requested_information'])
|
||||
|
||||
def parse_vocabulary(self):
|
||||
response = requests.get("https://www.wanikani.com/api/user/" + self.api_key + "/vocabulary/")
|
||||
@ -77,7 +77,7 @@ class User(db.Model):
|
||||
if data.get('error'):
|
||||
raise ValueError(data['error']['message'])
|
||||
if data.get('requested_information'):
|
||||
self.vocabulary = str(data['requested_information']['general'])
|
||||
self.vocabulary = json.dumps(data['requested_information']['general'])
|
||||
|
||||
def update_all(self):
|
||||
if (datetime.utcnow() - self.last_updated) > timedelta(hours=1):
|
||||
|
Loading…
Reference in New Issue
Block a user