Return not found on error jsondoc

This commit is contained in:
2012-01-21 23:54:06 +00:00
parent 732ed2c2f1
commit 7b7e4a5e33

View File

@@ -39,6 +39,9 @@ class RedditAccount(models.Model):
jsondoc = json.load(urllib.urlopen("http://reddit.com/user/%s/about.json" % self.username))
except:
raise self.DoesNotExist
if 'error' in jsondoc:
raise self.DoesNotExist
data = jsondoc['data']