From 7b7e4a5e33dd5494df7a2f2b74f002d0b56b18ac Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Sat, 21 Jan 2012 23:54:06 +0000 Subject: [PATCH] Return not found on error jsondoc --- app/reddit/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/reddit/models.py b/app/reddit/models.py index ee10360..ae05ead 100644 --- a/app/reddit/models.py +++ b/app/reddit/models.py @@ -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']