From e70114dfded579cec72f57f6490f134e520ee7b9 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Wed, 9 Jan 2019 20:51:48 +0100 Subject: Use proper default for infraction insertion date. --- api/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'api/models.py') diff --git a/api/models.py b/api/models.py index 176b7c46..092c2e8e 100644 --- a/api/models.py +++ b/api/models.py @@ -1,9 +1,9 @@ -import datetime from operator import itemgetter from django.contrib.postgres import fields as pgfields from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator from django.db import models +from django.utils import timezone from .validators import validate_tag_embed @@ -250,7 +250,7 @@ class Infraction(ModelReprMixin, models.Model): ("superstar", "Superstar") ) inserted_at = models.DateTimeField( - default=datetime.datetime.utcnow, + default=timezone.now, help_text="The date and time of the creation of this infraction." ) expires_at = models.DateTimeField( -- cgit v1.2.3