Skip to content

Commit

Permalink
Setting the signal for dgjano allauth
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Mann committed Nov 17, 2024
1 parent d5ff75b commit f0e071a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ repos:
(?x)(
.*/migrations/.*.py|
lesgrandsvoisins/settings/.*.py|
lesgv/settings/.*.py
lesgv/settings/.*.py|
lesgrandsvoisins/wsgi.py
)
- repo: https://github.com/pycqa/isort
rev: 5.12.0
Expand Down
9 changes: 0 additions & 9 deletions lesgrandsvoisins/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
from dotenv import load_dotenv # Pour les variables d'.env


# from allauth.account.signals import user_signed_up
# from django.contrib.auth.models import Group

# Prendre les variables d'environnement
load_dotenv()

Expand Down Expand Up @@ -449,9 +446,3 @@
# # ACCOUNT_SIGNUP_PASSWORD_ENTER_TWICE = False
# ACCOUNT_USERNAME_BLACKLIST = ["admin", "god"]
# # ACCOUNT_USERNAME_MIN_LENGTH = 2


# @receiver(user_signed_up)
# def user_signed_up_callback(sender, request, user, **kargs):
# dashboard_user_group = Group.objects.get(name="dashboard")
# user.groups.add(dashboard_user_group)
9 changes: 9 additions & 0 deletions lesgrandsvoisins/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@

import os

from allauth.account.signals import user_signed_up
from django.contrib.auth.models import Group
from django.core.wsgi import get_wsgi_application


os.environ.setdefault("DJANGO_SETTINGS_MODULE", "lesgrandsvoisins.settings.production")


@receiver(user_signed_up)
def user_signed_up_callback(sender, request, user, **kargs):
dashboard_user_group = Group.objects.get(name="dashboard")
user.groups.add(dashboard_user_group)


application = get_wsgi_application()

0 comments on commit f0e071a

Please sign in to comment.