mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Return not found on error jsondoc
This commit is contained in:
@@ -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']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user