def _share(self):
content = self.get_object()
try:
share = content.share(self.request.user.profile)
except ValidationError as e:
raise exceptions.ValidationError(e.message)
except Exception:
raise exceptions.APIException("Unknown error when creating share.")
return Response({"status": "ok", "content_id": share.id}, status=HTTP_201_CREATED)
评论列表
文章目录