From a8f25492d765eb71f4b33ba5662173200feab72d Mon Sep 17 00:00:00 2001 From: Bertrand Marron Date: Thu, 15 Oct 2015 10:28:55 -0400 Subject: [PATCH] Remove shoppingcart default date values The previous value means that those dates would have the value of whenever the models were imported. Reference TNL-3611 --- lms/djangoapps/shoppingcart/models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/shoppingcart/models.py b/lms/djangoapps/shoppingcart/models.py index 454430bda7..06e2801c63 100644 --- a/lms/djangoapps/shoppingcart/models.py +++ b/lms/djangoapps/shoppingcart/models.py @@ -1190,7 +1190,7 @@ class CourseRegistrationCode(models.Model): code = models.CharField(max_length=32, db_index=True, unique=True) course_id = CourseKeyField(max_length=255, db_index=True) created_by = models.ForeignKey(User, related_name='created_by_user') - created_at = models.DateTimeField(default=datetime.now(pytz.utc)) + created_at = models.DateTimeField(auto_now_add=True) order = models.ForeignKey(Order, db_index=True, null=True, related_name="purchase_order") mode_slug = models.CharField(max_length=100, null=True) is_valid = models.BooleanField(default=True) @@ -1225,7 +1225,7 @@ class RegistrationCodeRedemption(models.Model): order = models.ForeignKey(Order, db_index=True, null=True) registration_code = models.ForeignKey(CourseRegistrationCode, db_index=True) redeemed_by = models.ForeignKey(User, db_index=True) - redeemed_at = models.DateTimeField(default=datetime.now(pytz.utc), null=True) + redeemed_at = models.DateTimeField(auto_now_add=True, null=True) course_enrollment = models.ForeignKey(CourseEnrollment, null=True) @classmethod @@ -1300,7 +1300,7 @@ class Coupon(models.Model): course_id = CourseKeyField(max_length=255) percentage_discount = models.IntegerField(default=0) created_by = models.ForeignKey(User) - created_at = models.DateTimeField(default=datetime.now(pytz.utc)) + created_at = models.DateTimeField(auto_now_add=True) is_active = models.BooleanField(default=True) expiration_date = models.DateTimeField(null=True, blank=True)