From 31d7c7148e579c6586fa41321c92a87c72d39b06 Mon Sep 17 00:00:00 2001 From: Shavkatjon Odamboyev <153182519+Shavkatjon-O@users.noreply.github.com> Date: Thu, 22 Aug 2024 18:44:35 +0500 Subject: [PATCH] fix: custom user --- .../migrations/0002_remove_user_full_name.py | 17 +++++++++++++++++ apps/users/models.py | 1 - apps/users/serializers.py | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 apps/users/migrations/0002_remove_user_full_name.py diff --git a/apps/users/migrations/0002_remove_user_full_name.py b/apps/users/migrations/0002_remove_user_full_name.py new file mode 100644 index 0000000..a212d42 --- /dev/null +++ b/apps/users/migrations/0002_remove_user_full_name.py @@ -0,0 +1,17 @@ +# Generated by Django 5.0.7 on 2024-08-22 13:44 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0001_initial'), + ] + + operations = [ + migrations.RemoveField( + model_name='user', + name='full_name', + ), + ] diff --git a/apps/users/models.py b/apps/users/models.py index 70a290d..3716789 100644 --- a/apps/users/models.py +++ b/apps/users/models.py @@ -11,7 +11,6 @@ class User(AbstractUser, BaseModel): last_name = None email = models.EmailField(unique=True) - full_name = models.CharField(max_length=256) REQUIRED_FIELDS = [] USERNAME_FIELD = "email" diff --git a/apps/users/serializers.py b/apps/users/serializers.py index 86585a9..34fcd72 100644 --- a/apps/users/serializers.py +++ b/apps/users/serializers.py @@ -1,6 +1,7 @@ from rest_framework import serializers from django.contrib.auth import get_user_model + User = get_user_model()