Use json instead of deprecated django.utils.simplejson

This commit is contained in:
Tony Zhu 2014-03-31 14:43:59 -04:00
parent b6339cc016
commit fced647271

View File

@ -11,13 +11,13 @@ The API documentation can be accessed by visiting http://helpdesk/api/help/
through templates/helpdesk/help_api.html. through templates/helpdesk/help_api.html.
""" """
import json
from django import forms from django import forms
from django.contrib.auth import authenticate from django.contrib.auth import authenticate
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.http import HttpResponse from django.http import HttpResponse
from django.shortcuts import render_to_response from django.shortcuts import render_to_response
from django.template import loader, Context from django.template import loader, Context
from django.utils import simplejson
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
try: try:
@ -116,7 +116,7 @@ class API:
def api_public_list_queues(self): def api_public_list_queues(self):
return api_return(STATUS_OK, simplejson.dumps([{"id": "%s" % q.id, "title": "%s" % q.title} for q in Queue.objects.all()]), json=True) return api_return(STATUS_OK, json.dumps([{"id": "%s" % q.id, "title": "%s" % q.title} for q in Queue.objects.all()]), json=True)
def api_public_find_user(self): def api_public_find_user(self):