mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-07 10:58:25 +02:00
Mark optional fields in bookmark serializer (#78)
This commit is contained in:
@@ -30,8 +30,11 @@ class BookmarkSerializer(serializers.ModelSerializer):
|
|||||||
'date_modified'
|
'date_modified'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Override optional char fields to provide default value
|
||||||
|
title = serializers.CharField(required=False, allow_blank=True, default='')
|
||||||
|
description = serializers.CharField(required=False, allow_blank=True, default='')
|
||||||
# Override readonly tag_names property to allow passing a list of tag names to create/update
|
# Override readonly tag_names property to allow passing a list of tag names to create/update
|
||||||
tag_names = TagListField()
|
tag_names = TagListField(required=False, default=[])
|
||||||
|
|
||||||
def create(self, validated_data):
|
def create(self, validated_data):
|
||||||
bookmark = Bookmark()
|
bookmark = Bookmark()
|
||||||
|
Reference in New Issue
Block a user