nk20/apps/note/apps.py

29 lines
736 B
Python
Raw Normal View History

2019-07-16 07:05:30 +00:00
# -*- mode: python; coding: utf-8 -*-
# Copyright (C) 2018-2019 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
2019-07-08 12:30:58 +00:00
from django.apps import AppConfig
2019-07-19 13:00:44 +00:00
from django.conf import settings
from django.db.models.signals import post_save
2019-07-16 07:05:30 +00:00
from django.utils.translation import gettext_lazy as _
2019-07-08 12:30:58 +00:00
2019-07-19 13:00:44 +00:00
from . import signals
2019-07-08 12:30:58 +00:00
class NoteConfig(AppConfig):
name = 'note'
2019-07-16 07:05:30 +00:00
verbose_name = _('note')
2019-07-19 13:00:44 +00:00
def ready(self):
"""
Define app internal signals to interact with other apps
"""
post_save.connect(
signals.save_user_note,
sender=settings.AUTH_USER_MODEL
)
post_save.connect(
signals.save_club_note,
sender='member.Club'
)