mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Show error message instead of 500 when reddit is unavailable
This commit is contained in:
@@ -70,7 +70,12 @@ def view_application(request, applicationid):
|
||||
|
||||
posts = []
|
||||
for acc in redditacc:
|
||||
posts.extend(acc.recent_posts())
|
||||
try:
|
||||
accposts = acc.recent_posts()
|
||||
except:
|
||||
reddit_error = "Encountered a error while trying to get all Reddit posts"
|
||||
accposts = []
|
||||
posts.extend(accposts)
|
||||
|
||||
return render_to_response('hr/applications/view.html', locals(), context_instance=RequestContext(request))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user