Commit 198b237d authored by okhin's avatar okhin 🚴

Working on stuff

parent 526de187
Pipeline #2506 passed with stages
in 2 minutes and 55 seconds
......@@ -3,3 +3,6 @@ from django.apps import AppConfig
class UserprofileConfig(AppConfig):
name = 'userprofile'
def ready(self):
import userprofile.signals
from django.core.signals import post_save
from django.dispatch import receiver
from rest_framework.authtoken.models import Token
from django.conf import settings
@receiver(post_save, sender=settings.AUTH_USER_MODEL)
def create_user_token(sender, instance=None, created=False, *args, **wkargs):
if created:
Token.objects.create(user=instance)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment