diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-19 11:33:55 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2017-04-19 11:33:55 +0200 | 
| commit | c01dad69507f774a61240be24c7e3ed04eb85a84 (patch) | |
| tree | 4ca3c01a8b710f13367d9bf424ec0c6b8efc3cd9 | |
| parent | d58d6f19b6876c7330bee64736d72a682db9d3f2 (diff) | |
| download | Ishtar-c01dad69507f774a61240be24c7e3ed04eb85a84.tar.bz2 Ishtar-c01dad69507f774a61240be24c7e3ed04eb85a84.zip | |
Force history date for first historic save
| -rw-r--r-- | ishtar_common/models.py | 5 | 
1 files changed, 3 insertions, 2 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index ea2f47af2..357140ea4 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -185,7 +185,7 @@ class HistoricalRecords(BaseHistoricalRecords):              history_modifier = getattr(instance, 'history_modifier', None)              assert history_modifier          except (User.DoesNotExist, AssertionError): -            # on batch removing of users, user could have disapeared +            # on batch removing of users, user could have disappeared              return          manager = getattr(instance, self.manager_name)          attrs = {} @@ -195,7 +195,8 @@ class HistoricalRecords(BaseHistoricalRecords):              .filter(history_modifier_id=history_modifier.pk)\              .order_by('-history_date', '-history_id')          if not q_history.count(): -            manager.create(history_type=type, **attrs) +            manager.create(history_type=type, +                           history_date=datetime.datetime.now(), **attrs)              return          old_instance = q_history.all()[0]          # multiple saving by the same user in a very short time are generaly | 
