mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05:00
Fix: Coerce language app config field to None if empty
This commit is contained in:
@@ -125,8 +125,11 @@ class ApplicationConfigurationSerializer(serializers.ModelSerializer):
|
||||
user_args = 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 "language" in data and data["language"] == "":
|
||||
data["language"] = None
|
||||
return super().run_validation(data)
|
||||
|
||||
class Meta:
|
||||
|
Reference in New Issue
Block a user