You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
580 B

  1. import importlib
  2. from django.apps import AppConfig
  3. from django.db.models.signals import post_save
  4. class MembersConfig(AppConfig):
  5. default_auto_field = 'django.db.models.BigAutoField'
  6. name = 'members'
  7. def ready(self):
  8. importlib.import_module('members.signals')
  9. from api.models import Project
  10. from .signals import add_administrator_on_project_creation
  11. # Registering signals with the subclasses of project.
  12. for project in Project.__subclasses__():
  13. post_save.connect(add_administrator_on_project_creation, project)