mirror of
https://github.com/evgen-app/chess_rpg_backend.git
synced 2024-11-10 19:57:12 +03:00
12 lines
387 B
Python
12 lines
387 B
Python
from django.db.models.signals import post_save
|
|
from django.dispatch import receiver
|
|
from .models import Player, PlayerAuthSession
|
|
from .services.deck_handler import create_first_deck
|
|
|
|
|
|
@receiver(post_save, sender=Player)
|
|
def create_player(sender, instance, created, **kwargs):
|
|
if created:
|
|
PlayerAuthSession.objects.create(player=instance)
|
|
create_first_deck(instance)
|