Skip to content

Commit 7942245

Browse files
🚦 added github_user_created signal
1 parent 570379c commit 7942245

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

django_rest_github_oauth/register.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
from django.contrib.auth.models import User
66
from rest_framework.exceptions import AuthenticationFailed
77

8+
from django_rest_github_oauth.signals import github_user_created
9+
810
from .models import GitHubAccount
911
from .response import UserResponse
1012
from .utils import id_generator
@@ -50,4 +52,5 @@ def register_social_user(provider: str, user_data: dict) -> str:
5052

5153
GitHubAccount.objects.create(user=user).save()
5254
user.save()
55+
github_user_created.send(sender=None, user=user)
5356
return UserResponse.get_user_payload(user)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from django.dispatch import Signal
2+
3+
github_user_created = Signal(providing_args=["user"])

0 commit comments

Comments
 (0)