2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-02-19 13:18:03 +00:00

Some small style fixes (#6916)

* fix dockerfile syntax

* remove unused import

* Merge unnecessary if statements

* fix PUI package name

* remove unused vars

* Remove unneeded pass

* merge if to reduce likelyhood of future errors

* add ignroe script to secure against shell scripts

* fix possible collisions

* export strings

* fix types
This commit is contained in:
Matthias Mair
2024-04-03 09:26:03 +01:00
committed by GitHub
parent 6be2ede5e8
commit 85e672831b
29 changed files with 96 additions and 107 deletions

View File

@@ -142,9 +142,8 @@ class SampleValidatorPlugin(SettingsMixin, ValidationMixin, InvenTreePlugin):
"""
prefix = self.get_setting('BATCH_CODE_PREFIX')
if len(batch_code) > 0:
if prefix and not batch_code.startswith(prefix):
self.raise_error(f"Batch code must start with '{prefix}'")
if len(batch_code) > 0 and prefix and not batch_code.startswith(prefix):
self.raise_error(f"Batch code must start with '{prefix}'")
def generate_batch_code(self):
"""Generate a new batch code."""