fix migrations error

This commit is contained in:
xoliqberdiyev
2026-04-24 17:55:19 +05:00
parent 5e1b02064e
commit 1db936126d
3 changed files with 97 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ class User(auth_models.AbstractUser):
default=RoleChoice.USER,
)
avatar = models.ImageField(upload_to="avatars/", null=True, blank=True)
permission = models.ForeignKey(Role, on_delete=models.SET_NULL, null=True)
permission = models.ForeignKey(Role, on_delete=models.SET_NULL, null=True, blank=True, related_name='users')
USERNAME_FIELD = "phone"
objects = UserManager()