def form_valid(self, form, pendencies_form):
self.object = form.save(commit = False)
if not self.object.topic.visible and not self.object.topic.repository:
self.object.visible = False
self.object.save()
pend_form = pendencies_form.save(commit = False)
pend_form.resource = self.object
if not pend_form.action == "":
pend_form.save()
self.log_context['category_id'] = self.object.topic.subject.category.id
self.log_context['category_name'] = self.object.topic.subject.category.name
self.log_context['category_slug'] = self.object.topic.subject.category.slug
self.log_context['subject_id'] = self.object.topic.subject.id
self.log_context['subject_name'] = self.object.topic.subject.name
self.log_context['subject_slug'] = self.object.topic.subject.slug
self.log_context['topic_id'] = self.object.topic.id
self.log_context['topic_name'] = self.object.topic.name
self.log_context['topic_slug'] = self.object.topic.slug
self.log_context['pdffile_id'] = self.object.id
self.log_context['pdffile_name'] = self.object.name
self.log_context['pdffile_slug'] = self.object.slug
super(UpdateView, self).createLog(self.request.user, self.log_component, self.log_action, self.log_resource, self.log_context)
return redirect(self.get_success_url())
评论列表
文章目录