From ca0f4e00310aed0551f8fad5c57f90fae2177f04 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 14 Jul 2022 20:21:53 +1000 Subject: [PATCH] And similar fix for BuildOrder reference field --- InvenTree/build/migrations/0032_auto_20211014_0632.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/InvenTree/build/migrations/0032_auto_20211014_0632.py b/InvenTree/build/migrations/0032_auto_20211014_0632.py index ea6d5c954d..1ae56af4e6 100644 --- a/InvenTree/build/migrations/0032_auto_20211014_0632.py +++ b/InvenTree/build/migrations/0032_auto_20211014_0632.py @@ -24,6 +24,10 @@ def build_refs(apps, schema_editor): except Exception: # pragma: no cover ref = 0 + # Clip integer value to ensure it does not overflow database field + if ref > 0x7fffffff: + ref = 0x7fffffff + build.reference_int = ref build.save()