bornhack-website/src/program/apps.py
Thomas Steen Rasmussen bf7578a833
Send emails when proposals are accepted/rejected, and when eventinstances are created/updated (#466)
* fixup labels and help_text for the email field

* add email and published columns to speaker proposal table, add published column to event proposal table

* send email to user when a speaker or eventproposal is accepted or rejected. Send email to submitter and all speakers when an eventinstance is created, or when the time is updated (event is rescheduled). Fix a few other small things while here.
2020-03-05 12:23:42 +01:00

25 lines
777 B
Python

from django.apps import AppConfig
from django.db.models.signals import m2m_changed, post_save, pre_save
class ProgramConfig(AppConfig):
name = "program"
def ready(self):
from .models import Speaker, EventInstance
from .signal_handlers import (
check_speaker_event_camp_consistency,
check_speaker_camp_change,
eventinstance_pre_save,
eventinstance_post_save,
)
m2m_changed.connect(
check_speaker_event_camp_consistency, sender=Speaker.events.through
)
pre_save.connect(check_speaker_camp_change, sender=Speaker)
pre_save.connect(eventinstance_pre_save, sender=EventInstance)
post_save.connect(eventinstance_post_save, sender=EventInstance)