From 127d57e386cf7d1ae5e7cbdea21aa4607cc2bd59 Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Wed, 23 Jan 2013 12:21:54 +1100 Subject: [PATCH] Fix timezone import for Django < 1.4 --- helpdesk/views/api.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/helpdesk/views/api.py b/helpdesk/views/api.py index 6a1bbcd3..64e162e7 100644 --- a/helpdesk/views/api.py +++ b/helpdesk/views/api.py @@ -17,9 +17,14 @@ 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, timezone +from django.utils import simplejson from django.views.decorators.csrf import csrf_exempt +try: + from django.utils import timezone +except ImportError: + from datetime import datetime as timezone + from helpdesk.forms import TicketForm from helpdesk.lib import send_templated_mail, safe_template_context from helpdesk.models import Ticket, Queue, FollowUp