From 9709989f06ab3038b66d288d7dbc3ecd61d8944f Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Thu, 21 Mar 2013 17:18:41 -0400 Subject: [PATCH] remove cruft from Course.save --- karmaworld/apps/courses/models.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/karmaworld/apps/courses/models.py b/karmaworld/apps/courses/models.py index 40e5a32..58fa6a3 100644 --- a/karmaworld/apps/courses/models.py +++ b/karmaworld/apps/courses/models.py @@ -76,6 +76,7 @@ class Course(models.Model): instructor_email = models.EmailField(blank=True, null=True) updated_at = models.DateTimeField(default=datetime.datetime.utcnow) + created_at = models.DateTimeField(auto_now_add=True) @@ -91,8 +92,6 @@ class Course(models.Model): def save(self, *args, **kwargs): """ Save school and generate a slug if one doesn't exist """ - if self.school_name != self.school.name: - self.school_name = self.school.name super(Course, self).save(*args, **kwargs) # generate a self.id if not self.slug: self.slug = defaultfilters.slugify("%s %s" % (self.name, self.id)) -- 2.25.1