update user model

This commit is contained in:
2025-10-27 08:36:12 +03:30
parent 0ce2938344
commit 96cbd5a475
3 changed files with 37 additions and 10 deletions

View File

@@ -1,10 +1,10 @@
from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import (
AbstractUser
)
from apps.core.models import BaseModel
from django.db import models
from apps.core.models import BaseModel
class User(AbstractUser, BaseModel):
mobile = models.CharField(max_length=18, null=True)
@@ -23,6 +23,8 @@ class User(AbstractUser, BaseModel):
help_text="N is natural & L is legal"
)
address = models.TextField(max_length=1000, null=True)
unit_name = models.CharField(max_length=150, null=True)
unit_national_id = models.CharField(max_length=25, null=True)
photo = models.CharField(max_length=50, null=True)
province = models.ForeignKey(
'Province',
@@ -155,7 +157,7 @@ class OrganizationStats(BaseModel):
def __str__(self):
return f'Organization: {self.organization.name}'
def save(self, *args, **kwargs):
return super(OrganizationStats, self).save(*args, **kwargs)