diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 5 | 
1 files changed, 5 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index a2da684c5..4f64d6f8f 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -379,11 +379,16 @@ class HistoryError(Exception):  class BaseHistorizedItem(models.Model):      history_modifier = models.ForeignKey(User, related_name='+',                                        verbose_name=_(u"Last editor")) +    history_creator = models.ForeignKey(User, related_name='+', +                                      verbose_name=_(u"Creator"), blank=True, +                                      null=True)      class Meta:          abstract = True      def save(self, *args, **kwargs):          assert hasattr(self, 'history_modifier') == True +        if not self.id: +            self.history_creator = self.history_modifier          super(BaseHistorizedItem, self).save(*args, **kwargs)          return True | 
