- if self.pk is not None:
- orig = type(self).objects.get(pk=self.pk)
- published_now = False
- for lc, ln in settings.LANGUAGES:
- if (getattr(self, "published_%s" % lc)
- and getattr(self, "published_at_%s" % lc) is None):
- setattr(self, "published_at_%s" % lc, datetime.now())
+ published_now = False
+ for lc, ln in settings.LANGUAGES:
+ if (getattr(self, "published_%s" % lc)
+ and getattr(self, "published_at_%s" % lc) is None):
+ now = datetime.now()
+ setattr(self, "published_at_%s" % lc, now)
+ if self.first_published_at is None:
+ self.first_published_at = now