from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager


class MyAccountManager(BaseUserManager):

    def create_user(self, email, username, password=None):
        if not email:
            raise ValueError("Users must have an email address")
        if not username:
            raise ValueError("User must have an username")
        user = self.model(
            email=self.normalize_email(email),
            username=username,
        )
        user.set_password(password)
        user.save(using=self._db)

        return user


class Account(AbstractBaseUser):
    email = models.EmailField(verbose_name="email", max_length=60, unique=True)
    name = models.CharField(max_length=30)
    username = models.CharField(max_length=30, unique=True)
    bio = models.CharField(max_length=100, default="new to bookshop")
    phone_number = models.CharField(max_length=11, verbose_name='phone number')
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']
    objects = MyAccountManager()

    def __str__(self):
        return self.email

    class Meta:
        verbose_name = 'account'
        verbose_name_plural = 'accounts'

bf51633233a17e9754fa8bcd7c7348f3bd4d892a
<mask token>


class Account(AbstractBaseUser):
    email = models.EmailField(verbose_name='email', max_length=60, unique=True)
    name = models.CharField(max_length=30)
    username = models.CharField(max_length=30, unique=True)
    bio = models.CharField(max_length=100, default='new to bookshop')
    phone_number = models.CharField(max_length=11, verbose_name='phone number')
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']
    objects = MyAccountManager()

    def __str__(self):
        return self.email


    class Meta:
        verbose_name = 'account'
        verbose_name_plural = 'accounts'

<mask token>


class MyAccountManager(BaseUserManager):
    <mask token>


class Account(AbstractBaseUser):
    email = models.EmailField(verbose_name='email', max_length=60, unique=True)
    name = models.CharField(max_length=30)
    username = models.CharField(max_length=30, unique=True)
    bio = models.CharField(max_length=100, default='new to bookshop')
    phone_number = models.CharField(max_length=11, verbose_name='phone number')
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']
    objects = MyAccountManager()

    def __str__(self):
        return self.email


    class Meta:
        verbose_name = 'account'
        verbose_name_plural = 'accounts'

<mask token>


class MyAccountManager(BaseUserManager):

    def create_user(self, email, username, password=None):
        if not email:
            raise ValueError('Users must have an email address')
        if not username:
            raise ValueError('User must have an username')
        user = self.model(email=self.normalize_email(email), username=username)
        user.set_password(password)
        user.save(using=self._db)
        return user


class Account(AbstractBaseUser):
    email = models.EmailField(verbose_name='email', max_length=60, unique=True)
    name = models.CharField(max_length=30)
    username = models.CharField(max_length=30, unique=True)
    bio = models.CharField(max_length=100, default='new to bookshop')
    phone_number = models.CharField(max_length=11, verbose_name='phone number')
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']
    objects = MyAccountManager()

    def __str__(self):
        return self.email


    class Meta:
        verbose_name = 'account'
        verbose_name_plural = 'accounts'

from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager


class MyAccountManager(BaseUserManager):

    def create_user(self, email, username, password=None):
        if not email:
            raise ValueError('Users must have an email address')
        if not username:
            raise ValueError('User must have an username')
        user = self.model(email=self.normalize_email(email), username=username)
        user.set_password(password)
        user.save(using=self._db)
        return user


class Account(AbstractBaseUser):
    email = models.EmailField(verbose_name='email', max_length=60, unique=True)
    name = models.CharField(max_length=30)
    username = models.CharField(max_length=30, unique=True)
    bio = models.CharField(max_length=100, default='new to bookshop')
    phone_number = models.CharField(max_length=11, verbose_name='phone number')
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']
    objects = MyAccountManager()

    def __str__(self):
        return self.email


    class Meta:
        verbose_name = 'account'
        verbose_name_plural = 'accounts'

from django.db import models
from django.contrib.auth.models import AbstractBaseUser, BaseUserManager


class MyAccountManager(BaseUserManager):

    def create_user(self, email, username, password=None):
        if not email:
            raise ValueError("Users must have an email address")
        if not username:
            raise ValueError("User must have an username")
        user = self.model(
            email=self.normalize_email(email),
            username=username,
        )
        user.set_password(password)
        user.save(using=self._db)

        return user


class Account(AbstractBaseUser):
    email = models.EmailField(verbose_name="email", max_length=60, unique=True)
    name = models.CharField(max_length=30)
    username = models.CharField(max_length=30, unique=True)
    bio = models.CharField(max_length=100, default="new to bookshop")
    phone_number = models.CharField(max_length=11, verbose_name='phone number')
    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ['username']
    objects = MyAccountManager()

    def __str__(self):
        return self.email

    class Meta:
        verbose_name = 'account'
        verbose_name_plural = 'accounts'
