Skip to content
Snippets Groups Projects
Commit 53e94d34 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[common][api] Adapt serializer for put on RetrieveUpdateDestroyContributionView

parent 18b7a932
Branches
No related tags found
No related merge requests found
This commit is part of merge request !327. Comments created here will be created in the context of that merge request.
...@@ -235,6 +235,11 @@ class RetrieveUpdateDestroyContributionView( ...@@ -235,6 +235,11 @@ class RetrieveUpdateDestroyContributionView(
): ):
model = Contribution model = Contribution
def get_serializer(self, *args, **kwargs):
if self.request.method == "PUT":
self.serializer_class = self.writing_serializer_class
return super().get_serializer(*args, **kwargs)
def get_object(self): def get_object(self):
version = self.kwargs["version"] version = self.kwargs["version"]
author_name = self.kwargs["author_name"] author_name = self.kwargs["author_name"]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment