mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 17:34:52 +03:00
Try linting again
This commit is contained in:
parent
e7ed1434c9
commit
eaf073d232
|
@ -37,7 +37,7 @@ class UserAdmin(auth_admin.UserAdmin):
|
|||
)
|
||||
list_display = ["{{cookiecutter.username_type}}", "name", "is_superuser"]
|
||||
search_fields = ["name"]
|
||||
{% if cookiecutter.username_type == "email" -%}
|
||||
{%- if cookiecutter.username_type == "email" -%}
|
||||
ordering = ["id"]
|
||||
add_fieldsets = (
|
||||
(
|
||||
|
|
|
@ -4,11 +4,11 @@ from django.contrib.auth.models import AbstractUser, UserManager as DjangoUserMa
|
|||
{%- else %}
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
{%- endif %}
|
||||
from django.db.models import CharField, EmailField
|
||||
from django.db.models import CharField{%- if cookiecutter.username_type == "email" %}, EmailField{% endif %}
|
||||
from django.urls import reverse
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
{% if cookiecutter.username_type == "email" -%}
|
||||
{%- if cookiecutter.username_type == "email" -%}
|
||||
class UserManager(DjangoUserManager):
|
||||
def _create_user(self, email, password, **extra_fields):
|
||||
"""
|
||||
|
@ -49,7 +49,7 @@ class User(AbstractUser):
|
|||
|
||||
#: First and last name do not cover name patterns around the globe
|
||||
name = CharField(_("Name of User"), blank=True, max_length=255)
|
||||
{% if cookiecutter.username_type == "email" -%}
|
||||
{%- if cookiecutter.username_type == "email" -%}
|
||||
username = None # type: ignore
|
||||
email = EmailField(_("email address"), unique=True)
|
||||
{%- endif %}
|
||||
|
|
Loading…
Reference in New Issue
Block a user