Merge pull request 'Upgrade to 3.12' (#630) from python-3.12 into main
[inboxen.git] / inboxen / apps.py
blobe7927598c3b077083c352d0c5b576863cce49aee
1 ##
2 # Copyright (C) 2015 Jessica Tallon & Matt Molyneaux
4 # This file is part of Inboxen.
6 # Inboxen is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU Affero General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # Inboxen is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Affero General Public License for more details.
16 # You should have received a copy of the GNU Affero General Public License
17 # along with Inboxen. If not, see <http://www.gnu.org/licenses/>.
20 from django.apps import AppConfig
21 from django.contrib.auth import get_user_model
22 from django.contrib.auth.signals import user_logged_out
23 from django.db.models.signals import post_save
26 class InboxenConfig(AppConfig):
27 name = "inboxen"
28 verbose_name = "Inboxen Core"
30 def ready(self):
31 from inboxen import checks # noqa
32 from inboxen import signals
34 user_logged_out.connect(signals.logout_message, dispatch_uid='inboxen_logout_message')
35 post_save.connect(signals.populate_user_one_to_one_fields, sender=get_user_model(),
36 dispatch_uid="user_one_to_one_fields")