forked from numerique-gouv/sites-faciles
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chris Mann
committed
Nov 17, 2024
1 parent
ce0c7be
commit 6ba36ac
Showing
3 changed files
with
24 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from allauth.account.signals import user_signed_up | ||
from django.apps import AppConfig | ||
from django.contrib.auth.models import Group | ||
|
||
|
||
def user_signed_up_callback(sender, request, user, **kargs): | ||
dashboard_user_group = Group.objects.get(name="dashboard") | ||
user.groups.add(dashboard_user_group) | ||
|
||
|
||
class LesGrandsVoisinsConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "lesgrandsvoisins" | ||
|
||
def ready(self): | ||
user_signed_up.connect(user_signed_up_callback) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
from allauth.account.signals import user_signed_up | ||
from django.contrib.auth.models import Group | ||
|
||
|
||
@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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters