bornhack-website/src/program/apps.py

19 lines
564 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
2017-08-14 16:58:19 +00:00
2016-07-13 17:13:47 +00:00
class ProgramConfig(AppConfig):
2019-06-16 12:32:24 +00:00
name = "program"
2017-01-23 17:57:30 +00:00
def ready(self):
2019-06-16 12:32:24 +00:00
from .models import Speaker, SpeakerProposal, EventProposal
2017-08-14 16:58:19 +00:00
from .signal_handlers import (
check_speaker_event_camp_consistency,
check_speaker_camp_change,
)
2019-06-16 12:32:24 +00:00
2017-08-14 16:58:19 +00:00
m2m_changed.connect(
2019-06-16 12:32:24 +00:00
check_speaker_event_camp_consistency, sender=Speaker.events.through
2017-08-14 16:58:19 +00:00
)
2017-01-23 17:57:30 +00:00
pre_save.connect(check_speaker_camp_change, sender=Speaker)