From c56e023088bcd5800d0eb0fe71bf8a2cfa7d90b1 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Wed, 29 Oct 2025 17:25:55 +0330 Subject: [PATCH] fix - replace BaseModel -> AbstrasctUser (MRO) --- ..._alter_user_options_alter_user_managers.py | 22 +++++++++++++++++++ apps/authentication/models.py | 9 +------- logs/django_requests.log | 4 ++++ 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 apps/authentication/migrations/0043_alter_user_options_alter_user_managers.py diff --git a/apps/authentication/migrations/0043_alter_user_options_alter_user_managers.py b/apps/authentication/migrations/0043_alter_user_options_alter_user_managers.py new file mode 100644 index 0000000..15c2da8 --- /dev/null +++ b/apps/authentication/migrations/0043_alter_user_options_alter_user_managers.py @@ -0,0 +1,22 @@ +# Generated by Django 5.0 on 2025-10-29 13:55 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('authentication', '0042_alter_organization_national_unique_id'), + ] + + operations = [ + migrations.AlterModelOptions( + name='user', + options={}, + ), + migrations.AlterModelManagers( + name='user', + managers=[ + ], + ), + ] diff --git a/apps/authentication/models.py b/apps/authentication/models.py index a9ddd65..e2a6c41 100644 --- a/apps/authentication/models.py +++ b/apps/authentication/models.py @@ -2,18 +2,11 @@ from django.contrib.auth.models import ( AbstractUser ) from django.db import models -from django.utils.translation import gettext_lazy as _ from apps.core.models import BaseModel -class User(AbstractUser, BaseModel): - username = models.CharField( - max_length=150, - help_text=_( - "Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only." - ), - ) +class User(BaseModel, AbstractUser): mobile = models.CharField(max_length=18, null=True) phone = models.CharField(max_length=18, null=True) national_code = models.CharField(max_length=16, null=True) diff --git a/logs/django_requests.log b/logs/django_requests.log index 2af26a2..448dbe4 100644 --- a/logs/django_requests.log +++ b/logs/django_requests.log @@ -587,3 +587,7 @@ AssertionError: .validate() should return the validated data [2025-10-29 16:58:00,956] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader [2025-10-29 17:09:28,263] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\models.py changed, reloading. [2025-10-29 17:09:30,370] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-10-29 17:10:43,489] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\models.py changed, reloading. +[2025-10-29 17:10:46,190] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader +[2025-10-29 17:25:00,650] INFO django.utils.autoreload | IP: - | Path: - | D:\Project\Rasaddam_Backend\apps\authentication\models.py changed, reloading. +[2025-10-29 17:25:02,925] INFO django.utils.autoreload | IP: - | Path: - | Watching for file changes with StatReloader