mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-22 07:48:13 +00:00
Fix: Don't require the JSON user arguments field (#5320)
* Allows new user args field to be null * Coerce empty string to None for user_args JSONField --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
1 parent
f525ac0af6
commit
a12e1fae72
2 files changed
+106
-1
No files matched your search
@@ -122,7 +122,12 @@ class ProfileSerializer(serializers.ModelSerializer):
|
||||
|
||||
|
||||
class ApplicationConfigurationSerializer(serializers.ModelSerializer):
|
||||
user_args = serializers.JSONField(binary=True)
|
||||
user_args = serializers.JSONField(binary=True, allow_null=True)
|
||||
|
||||
def run_validation(self, data):
|
||||
if "user_args" in data and data["user_args"] == "":
|
||||
data["user_args"] = None
|
||||
return super().run_validation(data)
|
||||
|
||||
class Meta:
|
||||
model = ApplicationConfiguration
|
||||
|
||||
Reference in new issue
Block a user