From 2dbb21f8e765eadc7d94319b7927266f0291571b Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 29 Nov 2021 23:46:41 +0100 Subject: [PATCH] make creation date none changeable on save --- .../0014_alter_notificationmessage_creation.py | 18 ++++++++++++++++++ InvenTree/common/models.py | 4 +--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 InvenTree/common/migrations/0014_alter_notificationmessage_creation.py diff --git a/InvenTree/common/migrations/0014_alter_notificationmessage_creation.py b/InvenTree/common/migrations/0014_alter_notificationmessage_creation.py new file mode 100644 index 0000000000..710e2c7e32 --- /dev/null +++ b/InvenTree/common/migrations/0014_alter_notificationmessage_creation.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.5 on 2021-11-29 22:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0013_notificationmessage'), + ] + + operations = [ + migrations.AlterField( + model_name='notificationmessage', + name='creation', + field=models.DateTimeField(auto_now_add=True), + ), + ] diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index 10b2796768..5ccd9cf7a7 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -1492,9 +1492,7 @@ class NotificationMessage(models.Model): ) creation = models.DateTimeField( - auto_now=True, - null=False, - editable=False, + auto_now_add=True, ) read = models.BooleanField(