mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-30 18:27:45 -05: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:
@@ -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