__create_user_modules_post_create.py 308 Bytes
Newer Older
1
2
from django.db.models.signals import post_save

3
from base_app.models import User
Florent Chehab's avatar
Florent Chehab committed
4
from backend_app.models.user import UserData
5
6
7
8
9
10
11
12


def create_user_modules(sender, instance, created, **kwargs):
    if created:
        UserData.objects.create(owner=instance)


post_save.connect(create_user_modules, sender=User)