Remove description from Presentation, add fields to proposal for notification template.
This commit is contained in:
parent
d9b1583dfe
commit
420d8ec870
7 changed files with 31 additions and 8 deletions
|
@ -1,4 +1,4 @@
|
||||||
Django>=1.9.2
|
Django==1.9.2
|
||||||
django-appconf==1.0.1
|
django-appconf==1.0.1
|
||||||
django-model-utils==2.4.0
|
django-model-utils==2.4.0
|
||||||
django-reversion==1.10.1
|
django-reversion==1.10.1
|
||||||
|
|
|
@ -196,8 +196,9 @@ class ProposalBase(models.Model):
|
||||||
def notification_email_context(self):
|
def notification_email_context(self):
|
||||||
return {
|
return {
|
||||||
"title": self.title,
|
"title": self.title,
|
||||||
"speaker": self.speaker.name,
|
"speaker": self.speaker,
|
||||||
"speakers": ', '.join([x.name for x in self.speakers()]),
|
"speakers": ', '.join([x.name for x in self.speakers()]),
|
||||||
|
"additional_speakers": self.additional_speakers,
|
||||||
"kind": self.kind.name,
|
"kind": self.kind.name,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -361,7 +361,6 @@ def promote_proposal(proposal):
|
||||||
else:
|
else:
|
||||||
presentation = Presentation(
|
presentation = Presentation(
|
||||||
title=proposal.title,
|
title=proposal.title,
|
||||||
description=proposal.description,
|
|
||||||
abstract=proposal.abstract,
|
abstract=proposal.abstract,
|
||||||
speaker=proposal.speaker,
|
speaker=proposal.speaker,
|
||||||
section=proposal.section,
|
section=proposal.section,
|
||||||
|
|
|
@ -645,7 +645,11 @@ def result_notification_send(request, section_slug, status):
|
||||||
rn.template = notification_template
|
rn.template = notification_template
|
||||||
rn.to_address = proposal.speaker_email
|
rn.to_address = proposal.speaker_email
|
||||||
rn.from_address = request.POST["from_address"]
|
rn.from_address = request.POST["from_address"]
|
||||||
rn.subject = request.POST["subject"]
|
rn.subject = Template(request.POST["subject"]).render(
|
||||||
|
Context({
|
||||||
|
"proposal": proposal.notification_email_context()
|
||||||
|
})
|
||||||
|
)
|
||||||
rn.body = Template(request.POST["body"]).render(
|
rn.body = Template(request.POST["body"]).render(
|
||||||
Context({
|
Context({
|
||||||
"proposal": proposal.notification_email_context()
|
"proposal": proposal.notification_email_context()
|
||||||
|
|
23
symposion/schedule/migrations/0002_auto_20160903_0146.py
Normal file
23
symposion/schedule/migrations/0002_auto_20160903_0146.py
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.9.2 on 2016-09-03 01:46
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('symposion_schedule', '0001_initial'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='presentation',
|
||||||
|
name='description',
|
||||||
|
),
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='presentation',
|
||||||
|
name='description_html',
|
||||||
|
),
|
||||||
|
]
|
|
@ -185,8 +185,6 @@ class Presentation(models.Model):
|
||||||
|
|
||||||
slot = models.OneToOneField(Slot, null=True, blank=True, related_name="content_ptr", verbose_name=_("Slot"))
|
slot = models.OneToOneField(Slot, null=True, blank=True, related_name="content_ptr", verbose_name=_("Slot"))
|
||||||
title = models.CharField(max_length=100, verbose_name=_("Title"))
|
title = models.CharField(max_length=100, verbose_name=_("Title"))
|
||||||
description = models.TextField(verbose_name=_("Description"))
|
|
||||||
description_html = models.TextField(blank=True)
|
|
||||||
abstract = models.TextField(verbose_name=_("Abstract"))
|
abstract = models.TextField(verbose_name=_("Abstract"))
|
||||||
abstract_html = models.TextField(blank=True)
|
abstract_html = models.TextField(blank=True)
|
||||||
speaker = models.ForeignKey(Speaker, related_name="presentations", verbose_name=_("Speaker"))
|
speaker = models.ForeignKey(Speaker, related_name="presentations", verbose_name=_("Speaker"))
|
||||||
|
@ -197,7 +195,6 @@ class Presentation(models.Model):
|
||||||
section = models.ForeignKey(Section, related_name="presentations", verbose_name=_("Section"))
|
section = models.ForeignKey(Section, related_name="presentations", verbose_name=_("Section"))
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
self.description_html = parse(self.description)
|
|
||||||
self.abstract_html = parse(self.abstract)
|
self.abstract_html = parse(self.abstract)
|
||||||
return super(Presentation, self).save(*args, **kwargs)
|
return super(Presentation, self).save(*args, **kwargs)
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,6 @@ def schedule_json(request):
|
||||||
s.email for s in slot.content.speakers()
|
s.email for s in slot.content.speakers()
|
||||||
] if request.user.is_staff else ["redacted"],
|
] if request.user.is_staff else ["redacted"],
|
||||||
"abstract": slot.content.abstract.raw,
|
"abstract": slot.content.abstract.raw,
|
||||||
"description": slot.content.description.raw,
|
|
||||||
"conf_url": "%s://%s%s" % (
|
"conf_url": "%s://%s%s" % (
|
||||||
protocol,
|
protocol,
|
||||||
Site.objects.get_current().domain,
|
Site.objects.get_current().domain,
|
||||||
|
|
Loading…
Reference in a new issue