aboutsummaryrefslogtreecommitdiffstats
path: root/pydis_site/apps/api/apps.py
diff options
context:
space:
mode:
authorGravatar D0rs4n <[email protected]>2021-08-31 16:27:18 +0200
committerGravatar D0rs4n <[email protected]>2021-11-26 21:14:16 +0100
commitf093907393b4f479f62409286831b938ba65c558 (patch)
tree389689c8ebe865af10eb53a35b5c1df63b805d32 /pydis_site/apps/api/apps.py
parentMerge pull request #619 from hedyhli/patch-1 (diff)
Create a signal to unassign roles from user when deleted
Add a signal to the api app that automatically unassigns deleted roles from users that have them
Diffstat (limited to 'pydis_site/apps/api/apps.py')
-rw-r--r--pydis_site/apps/api/apps.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pydis_site/apps/api/apps.py b/pydis_site/apps/api/apps.py
index 76810b2e..18eda9e3 100644
--- a/pydis_site/apps/api/apps.py
+++ b/pydis_site/apps/api/apps.py
@@ -4,4 +4,12 @@ from django.apps import AppConfig
class ApiConfig(AppConfig):
"""Django AppConfig for the API app."""
- name = 'api'
+ name = 'pydis_site.apps.api'
+
+ def ready(self) -> None:
+ """
+ Gets called as soon as the registry is fully populated.
+
+ https://docs.djangoproject.com/en/3.2/ref/applications/#django.apps.AppConfig.ready
+ """
+ import pydis_site.apps.api.signals # noqa: F401