2020-09-21 13:41:55 +00:00
|
|
|
from django.apps import AppConfig
|
2020-09-24 10:06:33 +00:00
|
|
|
from django.db.models.signals import post_save, pre_save
|
2020-09-21 13:41:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
class RegistrationConfig(AppConfig):
|
2020-10-30 18:46:46 +00:00
|
|
|
"""
|
|
|
|
Registration app contains the detail about users only.
|
|
|
|
"""
|
2020-09-21 13:41:55 +00:00
|
|
|
name = 'registration'
|
2020-09-22 10:27:03 +00:00
|
|
|
|
|
|
|
def ready(self):
|
2020-10-31 12:41:16 +00:00
|
|
|
from registration.signals import create_admin_registration, invite_to_public_rooms, \
|
|
|
|
set_username, send_email_link
|
2020-09-22 10:27:03 +00:00
|
|
|
pre_save.connect(set_username, "auth.User")
|
2020-09-22 17:37:37 +00:00
|
|
|
pre_save.connect(send_email_link, "auth.User")
|
2020-09-22 10:27:03 +00:00
|
|
|
post_save.connect(create_admin_registration, "auth.User")
|
2020-10-31 12:41:16 +00:00
|
|
|
post_save.connect(invite_to_public_rooms, "registration.Registration")
|