Skip to content

Commit

Permalink
Adding user to a default group on creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Mann committed Nov 17, 2024
1 parent 0b9febc commit 6e1bc25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ repos:
hooks:
- id: flake8
exclude: /migrations/
exclude: lesgrandsvoisins/settings/production.py
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down
9 changes: 9 additions & 0 deletions lesgrandsvoisins/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
from allauth.account.signals import user_signed_up

from .base import *


DEBUG = False

try:
from .local import *
except ImportError:
pass


@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)

0 comments on commit 6e1bc25

Please sign in to comment.