Fixed patch method
This commit is contained in:
parent
280da6a1a4
commit
d5cab4a322
@ -20,9 +20,18 @@ class PublicationSerializer(serializers.ModelSerializer):
|
||||
return getattr(obj, 'average_score', 0)
|
||||
|
||||
def validate(self, attrs):
|
||||
content_type = attrs.get('content_type')
|
||||
image = attrs.get('image')
|
||||
video = attrs.get('video')
|
||||
content_type = attrs.get(
|
||||
'content_type',
|
||||
getattr(self.instance, 'content_type', None)
|
||||
)
|
||||
image = attrs.get(
|
||||
'image',
|
||||
getattr(self.instance, 'image', None)
|
||||
)
|
||||
video = attrs.get(
|
||||
'video',
|
||||
getattr(self.instance, 'video', None)
|
||||
)
|
||||
|
||||
errors = {}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user