Add MinLengthValidator to short barcode prefix setting

This commit is contained in:
Lukas 2024-07-19 23:31:42 +02:00 committed by GitHub
parent 3a2d46ff72
commit 76043ed96b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),
},
}