pedagogy: fix error with author change on comment when edited by an admin

This commit is contained in:
2019-06-16 18:34:11 +02:00
parent 8512f3c5d0
commit c467165bf3
2 changed files with 4 additions and 2 deletions

View File

@ -110,8 +110,9 @@ class UVCommentUpdateView(CanEditPropMixin, UpdateView):
def get_form_kwargs(self):
kwargs = super(UVCommentUpdateView, self).get_form_kwargs()
kwargs["author_id"] = self.request.user.id
kwargs["uv_id"] = self.get_object().uv.id
obj = self.get_object()
kwargs["author_id"] = obj.author.id
kwargs["uv_id"] = obj.uv.id
return kwargs