From fced64727113b398754752daaf2adb20b58704bd Mon Sep 17 00:00:00 2001 From: Tony Zhu Date: Mon, 31 Mar 2014 14:43:59 -0400 Subject: [PATCH 1/5] Use json instead of deprecated django.utils.simplejson --- helpdesk/views/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpdesk/views/api.py b/helpdesk/views/api.py index 64e162e7..2b386d77 100644 --- a/helpdesk/views/api.py +++ b/helpdesk/views/api.py @@ -11,13 +11,13 @@ The API documentation can be accessed by visiting http://helpdesk/api/help/ through templates/helpdesk/help_api.html. """ +import json from django import forms from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import loader, Context -from django.utils import simplejson from django.views.decorators.csrf import csrf_exempt try: @@ -116,7 +116,7 @@ class API: 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): From dc86236136feaa8b901ac6488ebb4562a9acb815 Mon Sep 17 00:00:00 2001 From: Tony Zhu Date: Thu, 23 Oct 2014 10:44:59 -0400 Subject: [PATCH 2/5] Go back to the original helpdesk repo --- helpdesk/views/api.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/helpdesk/views/api.py b/helpdesk/views/api.py index 1b682ff3..140c80c6 100644 --- a/helpdesk/views/api.py +++ b/helpdesk/views/api.py @@ -11,7 +11,6 @@ The API documentation can be accessed by visiting http://helpdesk/api/help/ through templates/helpdesk/help_api.html. """ -import json from django import forms from django.contrib.auth import authenticate try: @@ -121,7 +120,7 @@ class API: def api_public_list_queues(self): - return api_return(STATUS_OK, json.dumps([{"id": "%s" % q.id, "title": "%s" % q.title} for q in Queue.objects.all()]), json=True) + return api_return(STATUS_OK, simplejson.dumps([{"id": "%s" % q.id, "title": "%s" % q.title} for q in Queue.objects.all()]), json=True) def api_public_find_user(self): @@ -326,4 +325,3 @@ class API: ticket.save() return api_return(STATUS_OK) - From 8635742931f3ed78fdadd69fea563e5fb2efe5ae Mon Sep 17 00:00:00 2001 From: Tony Zhu Date: Thu, 23 Oct 2014 10:48:11 -0400 Subject: [PATCH 3/5] Rename the initial data to avoid django 1.7 flush bug --- helpdesk/fixtures/{initial_data.json => emailtemplates.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename helpdesk/fixtures/{initial_data.json => emailtemplates.json} (100%) diff --git a/helpdesk/fixtures/initial_data.json b/helpdesk/fixtures/emailtemplates.json similarity index 100% rename from helpdesk/fixtures/initial_data.json rename to helpdesk/fixtures/emailtemplates.json From 9600f457d838521fc5b7011a6fea3bdf25e88213 Mon Sep 17 00:00:00 2001 From: Tony Zhu Date: Tue, 14 Apr 2015 16:25:20 -0400 Subject: [PATCH 4/5] Remove no effect model property to silence django 1.8 system check warning --- helpdesk/models.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/helpdesk/models.py b/helpdesk/models.py index 505b3cba..69ebecbe 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -715,7 +715,6 @@ class PreSetReply(models.Model): queues = models.ManyToManyField( Queue, blank=True, - null=True, help_text=_('Leave blank to allow this reply to be used for all ' 'queues, or select those queues you wish to limit this reply to.'), ) @@ -757,7 +756,6 @@ class EscalationExclusion(models.Model): queues = models.ManyToManyField( Queue, blank=True, - null=True, help_text=_('Leave blank for this exclusion to be applied to all ' 'queues, or select those queues you wish to exclude with this ' 'entry.'), @@ -1061,7 +1059,6 @@ class IgnoreEmail(models.Model): queues = models.ManyToManyField( Queue, blank=True, - null=True, help_text=_('Leave blank for this e-mail to be ignored on all ' 'queues, or select those queues you wish to ignore this e-mail ' 'for.'), From 807e0c5ea98add83e1d74034fe06ff370780495d Mon Sep 17 00:00:00 2001 From: Tony Zhu Date: Tue, 14 Apr 2015 16:29:47 -0400 Subject: [PATCH 5/5] Remove extra space line --- helpdesk/views/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpdesk/views/api.py b/helpdesk/views/api.py index 04e32c4b..341337ac 100644 --- a/helpdesk/views/api.py +++ b/helpdesk/views/api.py @@ -324,4 +324,4 @@ class API: ticket.save() - return api_return(STATUS_OK) + return api_return(STATUS_OK) \ No newline at end of file