firs commit 🐼

This commit is contained in:
A'zamov Samandar
2025-04-19 14:29:36 +05:00
parent ad2b8c9717
commit a4b5833bbe
124 changed files with 5168 additions and 0 deletions

View File

@@ -0,0 +1 @@
from .user import * # noqa

View File

@@ -0,0 +1,10 @@
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth import get_user_model
@receiver(post_save, sender=get_user_model())
def user_signal(sender, created, instance, **kwargs):
if created and instance.username is None:
instance.username = "U%(id)s" % {"id": 1000 + instance.id}
instance.save()