aboutsummaryrefslogtreecommitdiffstats
path: root/api/models.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2019-01-09 20:51:48 +0100
committerGravatar Johannes Christ <[email protected]>2019-01-09 20:51:48 +0100
commite70114dfded579cec72f57f6490f134e520ee7b9 (patch)
treec81609623e19846a5a43962e2de67ec791a900c6 /api/models.py
parentAllow custom `inserted_at` infraction field for now. (diff)
Use proper default for infraction insertion date.
Diffstat (limited to 'api/models.py')
-rw-r--r--api/models.py4
1 files changed, 2 insertions, 2 deletions
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(