From 507794acf5c37b2bc8779bd0e69925acdb189a3d Mon Sep 17 00:00:00 2001 From: John Jarvis Date: Fri, 2 Nov 2012 13:35:56 -0400 Subject: [PATCH] Adding defaults to created and added fields --- lms/djangoapps/certificates/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/certificates/models.py b/lms/djangoapps/certificates/models.py index 8f62ee85c2..b9e348da1d 100644 --- a/lms/djangoapps/certificates/models.py +++ b/lms/djangoapps/certificates/models.py @@ -1,6 +1,6 @@ from django.contrib.auth.models import User from django.db import models - +from datetime import datetime ''' Certificates are created for a student and an offering of a course. @@ -59,8 +59,10 @@ class GeneratedCertificate(models.Model): distinction = models.BooleanField(default=False) status = models.CharField(max_length=32, default='unavailable') name = models.CharField(blank=True, max_length=255) - created_date = models.DateTimeField(auto_now_add=True) - modified_date = models.DateTimeField(auto_now=True) + created_date = models.DateTimeField( + auto_now_add=True, default=datetime.now) + modified_date = models.DateTimeField( + auto_now=True, default=datetime.now) class Meta: unique_together = (('user', 'course_id'),)