diff options
-rw-r--r-- | api/migrations/0025_allow_custom_inserted_at_infraction_field.py | 19 | ||||
-rw-r--r-- | api/models.py | 3 |
2 files changed, 21 insertions, 1 deletions
diff --git a/api/migrations/0025_allow_custom_inserted_at_infraction_field.py b/api/migrations/0025_allow_custom_inserted_at_infraction_field.py new file mode 100644 index 00000000..0c02cb91 --- /dev/null +++ b/api/migrations/0025_allow_custom_inserted_at_infraction_field.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1.4 on 2019-01-06 16:01 + +import datetime +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0024_add_note_infraction_type'), + ] + + operations = [ + migrations.AlterField( + model_name='infraction', + name='inserted_at', + field=models.DateTimeField(default=datetime.datetime.utcnow, help_text='The date and time of the creation of this infraction.'), + ), + ] diff --git a/api/models.py b/api/models.py index 480dba3d..176b7c46 100644 --- a/api/models.py +++ b/api/models.py @@ -1,3 +1,4 @@ +import datetime from operator import itemgetter from django.contrib.postgres import fields as pgfields @@ -249,7 +250,7 @@ class Infraction(ModelReprMixin, models.Model): ("superstar", "Superstar") ) inserted_at = models.DateTimeField( - auto_now_add=True, + default=datetime.datetime.utcnow, help_text="The date and time of the creation of this infraction." ) expires_at = models.DateTimeField( |