mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
pedagogy: fix error with author change on comment when edited by an admin
This commit is contained in:
parent
8512f3c5d0
commit
c467165bf3
@ -21,6 +21,7 @@
|
||||
<p>{{ comment.grade_work_load }}</p>
|
||||
<p>{{ comment.comment }}</p>
|
||||
<p>{% trans %}Published: {% endtrans %}{{ comment.publish_date }}</p>
|
||||
<p>{% trans %}Author: {% endtrans %}{{ comment.author }}</p>
|
||||
{% if user.is_owner(comment) %}
|
||||
<p><a href="{{ url('pedagogy:comment_edit', comment_id=comment.id) }}">{% trans %}Edit{% endtrans %}</a></p>
|
||||
<p><a href="{{ url('pedagogy:comment_delete', comment_id=comment.id) }}">{% trans %}Delete{% endtrans %}</a></p>
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user