bornhack-website/src/program/apps.py
Thomas Steen Rasmussen 00af109e2f
add flake8 and isort to pre-commit config, make flake8 and isort happy (#441)
* add flake8 to pre-commit config, and fixup many things to make flake8 happy

* add isort and sort all imports, add to pre-commit and requirements
2020-02-12 13:10:41 +01:00

19 lines
532 B
Python

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