mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Switch reddit posts to be a AJAX request
This commit is contained in:
17
hr/views.py
17
hr/views.py
@@ -88,14 +88,15 @@ def view_application(request, applicationid):
|
|||||||
else:
|
else:
|
||||||
return HttpResponseRedirect(reverse('hr.views.index'))
|
return HttpResponseRedirect(reverse('hr.views.index'))
|
||||||
|
|
||||||
posts = []
|
if response.GET.has_key('redditxhr'):
|
||||||
for acc in app.user.redditaccount_set.all():
|
posts = []
|
||||||
try:
|
for acc in app.user.redditaccount_set.all():
|
||||||
accposts = acc.recent_posts()
|
try:
|
||||||
except:
|
accposts = acc.recent_posts()
|
||||||
reddit_error = "Encountered a error while trying to get all Reddit posts"
|
except:
|
||||||
accposts = []
|
accposts = []
|
||||||
posts.extend(accposts)
|
posts.extend(accposts)
|
||||||
|
return HttpResponse(simplejson.dumps(accposts), mimetype='application/javascript')
|
||||||
|
|
||||||
return render_to_response('hr/applications/view.html', locals(), context_instance=RequestContext(request))
|
return render_to_response('hr/applications/view.html', locals(), context_instance=RequestContext(request))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user