use serializer variable for class assignment
@@ -204,5 +204,5 @@ class MetadataElementsRetrieveUpdate(generics.RetrieveUpdateDestroyAPIView):
resource = hydroshare.get_resource_by_shortkey(shortkey=pk)
serializer = resource.metadata.serializer
- self.serializer_class = resource.metadata.serializer
+ self.serializer_class = serializer
return Response(data=serializer.data, status=status.HTTP_202_ACCEPTED)
