mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add MinLengthValidator to short barcode prefix setting
This commit is contained in:
parent
3a2d46ff72
commit
76043ed96b
@ -11,6 +11,7 @@ import json
|
|||||||
import re
|
import re
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
from django.core.validators import MinLengthValidator
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
import plugin.base.barcodes.helper
|
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'
|
'Customize the prefix used for short barcodes, may be useful for environments with multiple InvenTree instances'
|
||||||
),
|
),
|
||||||
'default': 'INV-',
|
'default': 'INV-',
|
||||||
|
'validator': MinLengthValidator(1),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user