Fixed a regression (dropped auto_now for update). Also use timezone.now
instead of datetime.now
diff --git a/xos/core/models/plcorebase.py b/xos/core/models/plcorebase.py
index 76c2e54..6be949d 100644
--- a/xos/core/models/plcorebase.py
+++ b/xos/core/models/plcorebase.py
@@ -199,7 +199,7 @@
# default values for created and updated are only there to keep evolution
# from failing.
created = models.DateTimeField(auto_now_add=True)
- updated = models.DateTimeField(auto_now=True)
+ updated = models.DateTimeField(default=timezone.now)
enacted = models.DateTimeField(null=True, blank=True, default=None)
policed = models.DateTimeField(null=True, blank=True, default=None)
@@ -272,7 +272,7 @@
ignore_composite_key_check=False
if 'synchronizer' not in threading.current_thread().name:
- self.updated = datetime.datetime.now()
+ self.updated = timezone.now()
super(PlCoreBase, self).save(*args, **kwargs)