diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 6 | 
1 files changed, 5 insertions, 1 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 319f19539..c7223c898 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -175,9 +175,13 @@ class HistoricalRecords(BaseHistoricalRecords):          q = q_history.filter(history_date__isnull=False,                               history_date__gt=min_history_date) \              .order_by('-history_date', '-history_id') -        if q.count(): +        force = getattr(instance, "_force_history", False) +        if not force and q.count():              return +        if force: +            delattr(instance, '_force_history') +          if 'history_date' not in attrs or not attrs['history_date']:              attrs['history_date'] = datetime.datetime.now()          # record a new version only if data have been changed | 
