def _create_user(self, username, password, is_staff, is_superuser, **extra_fields):
    'Create and save a CustomUser with the given username and password. '
    now = timezone.now()
    if (not username):
        raise ValueError('The given username must be set')
    is_active = extra_fields.pop('is_active', True)
    user = self.model(username=username, is_staff=is_staff, is_active=is_active, is_superuser=is_superuser, last_login=now, date_joined=now, **extra_fields)
    user.set_password(password)
    user.save(using=self._db)
    return user
Create and save a CustomUser with the given username and password.
def _create_user(self, username, password, is_staff, is_superuser, **extra_fields):
    ' '
    now = timezone.now()
    if (not username):
        raise ValueError('The given username must be set')
    is_active = extra_fields.pop('is_active', True)
    user = self.model(username=username, is_staff=is_staff, is_active=is_active, is_superuser=is_superuser, last_login=now, date_joined=now, **extra_fields)
    user.set_password(password)
    user.save(using=self._db)
    return user