diff --git a/requirements/base.txt b/requirements/base.txt index a5e06485..db8c567e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -Django>=1.9.2 +Django==1.9.2 django-appconf==1.0.1 django-model-utils==2.4.0 django-reversion==1.10.1 diff --git a/symposion/proposals/models.py b/symposion/proposals/models.py index 4fe07c2d..e4b9e563 100644 --- a/symposion/proposals/models.py +++ b/symposion/proposals/models.py @@ -196,8 +196,9 @@ class ProposalBase(models.Model): def notification_email_context(self): return { "title": self.title, - "speaker": self.speaker.name, + "main_speaker": self.speaker, "speakers": ', '.join([x.name for x in self.speakers()]), + "additional_speakers": self.additional_speakers, "kind": self.kind.name, } diff --git a/symposion/reviews/admin.py b/symposion/reviews/admin.py index a4a33844..c5b0dd48 100644 --- a/symposion/reviews/admin.py +++ b/symposion/reviews/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin -from symposion.reviews.models import NotificationTemplate, ProposalResult +from symposion.reviews.models import NotificationTemplate, ProposalResult, ResultNotification admin.site.register( @@ -16,3 +16,5 @@ admin.site.register( ProposalResult, list_display=['proposal', 'status', 'score', 'vote_count', 'accepted'] ) + +admin.site.register(ResultNotification) \ No newline at end of file diff --git a/symposion/reviews/models.py b/symposion/reviews/models.py index 3baa4a6d..1a26f8dc 100644 --- a/symposion/reviews/models.py +++ b/symposion/reviews/models.py @@ -349,6 +349,9 @@ class ResultNotification(models.Model): for speaker in self.proposal.speakers(): yield speaker.email + def __unicode__(self): + return self.proposal.title + ' ' + self.timestamp.strftime('%Y-%m-%d %H:%M:%S') + @property def email_args(self): return (self.subject, self.body, self.from_address, self.recipients()) @@ -361,7 +364,6 @@ def promote_proposal(proposal): else: presentation = Presentation( title=proposal.title, - description=proposal.description, abstract=proposal.abstract, speaker=proposal.speaker, section=proposal.section, diff --git a/symposion/reviews/views.py b/symposion/reviews/views.py index d2ef40e5..eff2f929 100644 --- a/symposion/reviews/views.py +++ b/symposion/reviews/views.py @@ -645,10 +645,15 @@ def result_notification_send(request, section_slug, status): rn.template = notification_template rn.to_address = proposal.speaker_email rn.from_address = request.POST["from_address"] - rn.subject = request.POST["subject"] + proposal_context = proposal.notification_email_context() + rn.subject = Template(request.POST["subject"]).render( + Context({ + "proposal": proposal_context + }) + ) rn.body = Template(request.POST["body"]).render( Context({ - "proposal": proposal.notification_email_context() + "proposal": proposal_context }) ) rn.save() diff --git a/symposion/schedule/migrations/0002_auto_20160903_0146.py b/symposion/schedule/migrations/0002_auto_20160903_0146.py new file mode 100644 index 00000000..a1ca17e7 --- /dev/null +++ b/symposion/schedule/migrations/0002_auto_20160903_0146.py @@ -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', + ), + ] diff --git a/symposion/schedule/models.py b/symposion/schedule/models.py index 859faea1..c21a4367 100644 --- a/symposion/schedule/models.py +++ b/symposion/schedule/models.py @@ -185,8 +185,6 @@ class Presentation(models.Model): slot = models.OneToOneField(Slot, null=True, blank=True, related_name="content_ptr", verbose_name=_("Slot")) 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_html = models.TextField(blank=True) 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")) def save(self, *args, **kwargs): - self.description_html = parse(self.description) self.abstract_html = parse(self.abstract) return super(Presentation, self).save(*args, **kwargs) diff --git a/symposion/schedule/views.py b/symposion/schedule/views.py index 9c6d7c57..75472fc5 100644 --- a/symposion/schedule/views.py +++ b/symposion/schedule/views.py @@ -225,7 +225,6 @@ def schedule_json(request): s.email for s in slot.content.speakers() ] if request.user.is_staff else ["redacted"], "abstract": slot.content.abstract.raw, - "description": slot.content.description.raw, "conf_url": "%s://%s%s" % ( protocol, Site.objects.get_current().domain,