1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

default=timezone.default is better than auto_now_add=True

This commit is contained in:
Yohann D'ANELLO
2020-08-01 17:49:23 +02:00
parent f38b9801d0
commit cc04fa5555
4 changed files with 9 additions and 5 deletions

View File

@ -5,6 +5,7 @@ from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.db import models
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
@ -68,7 +69,7 @@ class Changelog(models.Model):
timestamp = models.DateTimeField(
null=False,
blank=False,
auto_now_add=True,
default=timezone.now,
name='timestamp',
verbose_name=_('timestamp'),
)