mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-14 18:46:52 +01:00
Enhancement: add barcode frontend config (#9742)
This commit is contained in:
parent
bcb0ae1ee5
commit
6a5be992c0
9 changed files with 437 additions and 49 deletions
|
|
@ -185,11 +185,14 @@ class ProfileSerializer(serializers.ModelSerializer):
|
|||
|
||||
class ApplicationConfigurationSerializer(serializers.ModelSerializer):
|
||||
user_args = serializers.JSONField(binary=True, allow_null=True)
|
||||
barcode_tag_mapping = serializers.JSONField(binary=True, allow_null=True)
|
||||
|
||||
def run_validation(self, data):
|
||||
# Empty strings treated as None to avoid unexpected behavior
|
||||
if "user_args" in data and data["user_args"] == "":
|
||||
data["user_args"] = None
|
||||
if "barcode_tag_mapping" in data and data["barcode_tag_mapping"] == "":
|
||||
data["barcode_tag_mapping"] = None
|
||||
if "language" in data and data["language"] == "":
|
||||
data["language"] = None
|
||||
return super().run_validation(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue