def form_valid(self, form):
if form.cleaned_data['email_notification']:
# Send notification if the presenter desire.
data = {
'presentation': self.object,
'base_url': settings.BASE_URL,
}
if self.object.present_type == self.model.PAPER_PRESENTATION:
data['paper'] = website_models.Publication.get_from_keyword(self.object.content)
text_body = render_to_string('meeting/update_content_email.txt', data)
html_body = render_to_string('meeting/update_content_email.html', data)
async('meeting.tasks.send_notification',
meeting=self.object.meeting,
body=text_body,
html_body=html_body,
)
return super(PresentUpdateView, self).form_valid(form)
评论列表
文章目录