diff options
author | 2019-01-09 20:51:48 +0100 | |
---|---|---|
committer | 2019-01-09 20:51:48 +0100 | |
commit | e70114dfded579cec72f57f6490f134e520ee7b9 (patch) | |
tree | c81609623e19846a5a43962e2de67ec791a900c6 /api/models.py | |
parent | Allow 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.py | 4 |
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( |