From aebfc02d2d6ff9742eec0416a137ca8264ee57d3 Mon Sep 17 00:00:00 2001 From: prathamesh Date: Tue, 15 Jul 2014 11:32:30 +0530 Subject: change made to subtract naive and aware datetimes --- testapp/exam/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'testapp/exam') diff --git a/testapp/exam/models.py b/testapp/exam/models.py index 4d82783..196ee73 100644 --- a/testapp/exam/models.py +++ b/testapp/exam/models.py @@ -304,7 +304,7 @@ class AnswerPaper(models.Model): def time_left(self): """Return the time remaining for the user in seconds.""" - dt = datetime.datetime.now() - self.start_time + dt = datetime.datetime.now() - self.start_time.replace(tzinfo=None) try: secs = dt.total_seconds() except AttributeError: -- cgit