alviandk / django-voting

Automatically exported from code.google.com/p/django-voting
0 stars 0 forks source link

views.xmlhttprequest_vote_on_object() should respond with correct MIME type #34

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
views.xmlhttprequest_vote_on_object() returns HttpResponse with invalid MIME 
type. The default 'text/html' is not changed there.

The following fix should do this:

    return HttpResponse(simplejson.dumps({
        'success': True,
        'score': Vote.objects.get_score(obj),
        }),
        content_type='application/json'
    )

Original issue reported on code.google.com by michal.s...@gmail.com on 10 Jan 2011 at 2:25