diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-03-23 14:46:23 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2022-03-23 14:46:23 +0100 |
commit | ae198221ef206740674088e43b96f52796c4feeb (patch) | |
tree | c2b2132f7a7ee0b82e8bcfc7b763851efb1fea15 | |
parent | 594e4f7c8db90f4ddc63d567acbcd05e7a0dc78c (diff) | |
download | Ishtar-ae198221ef206740674088e43b96f52796c4feeb.tar.bz2 Ishtar-ae198221ef206740674088e43b96f52796c4feeb.zip |
Remove auto update for last_modified - add a _no_last_modified_update
-rw-r--r-- | CHANGES.md | 8 | ||||
-rw-r--r-- | ishtar_common/models_common.py | 4 | ||||
-rw-r--r-- | ishtar_common/version.py | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/CHANGES.md b/CHANGES.md index bfeb8a3de..0ffe40bc7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,14 @@ Ishtar changelog ================ +v3.1.52 - 2022-03-23 +-------------------- + +### Bugs ### + +- remove auto update for last_modified - add a _no_last_modified_update + + v3.1.51 - 2022-03-09 -------------------- diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index 40b188158..445aa6647 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -1303,7 +1303,7 @@ class BaseHistorizedItem( blank=True, null=True, ) - last_modified = models.DateTimeField(auto_now=True) + last_modified = models.DateTimeField() history_m2m = JSONField(default={}, blank=True) need_update = models.BooleanField(verbose_name=_("Need update"), default=False) locked = models.BooleanField( @@ -1547,6 +1547,8 @@ class BaseHistorizedItem( def save(self, *args, **kwargs): created = not self.pk + if not getattr(self, "_no_last_modified_update", False): + self.last_modified = datetime.datetime.now() if not getattr(self, "skip_history_when_saving", False): assert hasattr(self, "history_modifier") if created: diff --git a/ishtar_common/version.py b/ishtar_common/version.py index a16106795..19fb137c0 100644 --- a/ishtar_common/version.py +++ b/ishtar_common/version.py @@ -1,5 +1,5 @@ -# 3.1.51 -VERSION = (3, 1, 51) +# 3.1.52 +VERSION = (3, 1, 52) def get_version(): |