bornhack-website/program/apps.py

13 lines
464 B
Python
Raw Normal View History

2016-07-13 17:13:47 +00:00
from django.apps import AppConfig
2017-01-23 17:57:30 +00:00
from django.db.models.signals import m2m_changed, pre_save
from .signal_handlers import check_speaker_event_camp_consistency, check_speaker_camp_change
2016-07-13 17:13:47 +00:00
class ProgramConfig(AppConfig):
name = 'program'
2017-01-23 17:57:30 +00:00
def ready(self):
from .models import Speaker
m2m_changed.connect(check_speaker_event_camp_consistency, sender=Speaker.events.through)
pre_save.connect(check_speaker_camp_change, sender=Speaker)