Make datetime handline offset-aware. Now requires pytz. Fixes #142.

This commit is contained in:
Ross Poulton
2013-01-23 10:59:12 +11:00
parent 13702852e1
commit 341a40b9ae
6 changed files with 24 additions and 28 deletions

View File

@ -11,15 +11,13 @@ The API documentation can be accessed by visiting http://helpdesk/api/help/
through templates/helpdesk/help_api.html.
"""
from datetime import datetime
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.utils import simplejson, timezone
from django.views.decorators.csrf import csrf_exempt
from helpdesk.forms import TicketForm
@ -182,7 +180,7 @@ class API:
f = FollowUp(
ticket=ticket,
date=datetime.now(),
date=timezone.now(),
comment=message,
user=self.request.user,
title='Comment Added',
@ -257,7 +255,7 @@ class API:
f = FollowUp(
ticket=ticket,
date=datetime.now(),
date=timezone.now(),
comment=resolution,
user=self.request.user,
title='Resolved',