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)
|
return getattr(obj, 'average_score', 0)
|
||||||
|
|
||||||
def validate(self, attrs):
|
def validate(self, attrs):
|
||||||
content_type = attrs.get('content_type')
|
content_type = attrs.get(
|
||||||
image = attrs.get('image')
|
'content_type',
|
||||||
video = attrs.get('video')
|
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 = {}
|
errors = {}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user