From c58b7b835b7776ce3942a04436c0ec5daac431ba Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 25 May 2026 12:30:48 +0000 Subject: [PATCH] Specify max field length --- src/backend/InvenTree/common/migrations/0044_note.py | 2 +- src/backend/InvenTree/common/models.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backend/InvenTree/common/migrations/0044_note.py b/src/backend/InvenTree/common/migrations/0044_note.py index afbb179eba..31045b8795 100644 --- a/src/backend/InvenTree/common/migrations/0044_note.py +++ b/src/backend/InvenTree/common/migrations/0044_note.py @@ -66,7 +66,7 @@ class Migration(migrations.Migration): ( "content", models.TextField( - blank=True, help_text="Note content", verbose_name="Content" + blank=True, help_text="Note content", verbose_name="Content", max_length=50000 ), ), ( diff --git a/src/backend/InvenTree/common/models.py b/src/backend/InvenTree/common/models.py index 962f27b32e..9dfbeee28d 100644 --- a/src/backend/InvenTree/common/models.py +++ b/src/backend/InvenTree/common/models.py @@ -2987,6 +2987,8 @@ class Note( created: Date/time that the note was created """ + NOTES_MAX_LENGTH = 50000 + class Meta: """Meta options for Note model.""" @@ -3138,7 +3140,10 @@ class Note( ) content = models.TextField( - blank=True, verbose_name=_('Content'), help_text=_('Note content') + blank=True, + verbose_name=_('Content'), + help_text=_('Note content'), + max_length=NOTES_MAX_LENGTH, )