From 76043ed96b1700ae50f9cfda7997629efa8d97e2 Mon Sep 17 00:00:00 2001 From: Lukas <76838159+wolflu05@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:31:42 +0200 Subject: [PATCH] Add MinLengthValidator to short barcode prefix setting --- .../InvenTree/plugin/builtin/barcodes/inventree_barcode.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backend/InvenTree/plugin/builtin/barcodes/inventree_barcode.py b/src/backend/InvenTree/plugin/builtin/barcodes/inventree_barcode.py index c3c0f75e2a..aeeaf7b3d1 100644 --- a/src/backend/InvenTree/plugin/builtin/barcodes/inventree_barcode.py +++ b/src/backend/InvenTree/plugin/builtin/barcodes/inventree_barcode.py @@ -11,6 +11,7 @@ import json import re from typing import cast +from django.core.validators import MinLengthValidator from django.utils.translation import gettext_lazy as _ import plugin.base.barcodes.helper @@ -45,6 +46,7 @@ class InvenTreeInternalBarcodePlugin(SettingsMixin, BarcodeMixin, InvenTreePlugi 'Customize the prefix used for short barcodes, may be useful for environments with multiple InvenTree instances' ), 'default': 'INV-', + 'validator': MinLengthValidator(1), }, }