Send Discord webhook when new user is created

This commit is contained in:
Joakim Hellsén 2024-03-15 14:49:51 +01:00
commit 4a47db73be
No known key found for this signature in database
GPG key ID: D196AE66FEBE1DC9
5 changed files with 224 additions and 2 deletions

View file

@ -15,6 +15,10 @@ class FeedVaultConfig(AppConfig):
default_auto_field: str = "django.db.models.BigAutoField"
name: str = "feedvault"
def ready(self) -> None:
# Make sure the signals are imported so they get used.
import feedvault.signals # noqa: F401, PLC0415
@receiver(signal=connection_created)
def activate_wal(sender: DatabaseWrapper, connection: DatabaseWrapper, **kwargs: dict) -> None: # noqa: ARG001