pedagogy: add script to remove all previous doubled comments

This commit is contained in:
2019-09-04 20:49:17 +02:00
parent ca042fe75e
commit a69f7b12b1
7 changed files with 215 additions and 124 deletions

View File

@ -1,6 +1,6 @@
# -*- coding:utf-8 -*
#
# Copyright 2017
# Copyright 2019
# - Sli <antoine@bartuccio.fr>
#
# Ce fichier fait partie du site de l'Association des Étudiants de l'UTBM,
@ -99,6 +99,7 @@ class UVDetailFormView(CanViewMixin, CanCreateUVFunctionMixin, DetailFormView):
kwargs = super(UVDetailFormView, self).get_form_kwargs()
kwargs["author_id"] = self.request.user.id
kwargs["uv_id"] = self.get_object().id
kwargs["is_creation"] = True
return kwargs
def form_valid(self, form):
@ -126,6 +127,7 @@ class UVCommentUpdateView(CanEditPropMixin, UpdateView):
obj = self.get_object()
kwargs["author_id"] = obj.author.id
kwargs["uv_id"] = obj.uv.id
kwargs["is_creation"] = False
return kwargs