mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-08-15 09:24:52 +03:00
Fix more empty lines issues
This commit is contained in:
parent
933d228607
commit
f6372c3ec2
|
@ -1,14 +1,16 @@
|
|||
{%- if cookiecutter.username_type == "email" %}
|
||||
from django.contrib.auth.hashers import make_password
|
||||
from django.contrib.auth.models import AbstractUser, UserManager as DjangoUserManager
|
||||
{%- else %}
|
||||
{%- endif -%}
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
{%- if cookiecutter.username_type == "email" %}
|
||||
from django.contrib.auth.models import UserManager as DjangoUserManager
|
||||
{%- endif %}
|
||||
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" %}
|
||||
|
||||
|
||||
class UserManager(DjangoUserManager):
|
||||
def _create_user(self, email, password, **extra_fields):
|
||||
"""
|
||||
|
|
|
@ -5,10 +5,7 @@ from {{ cookiecutter.project_slug }}.users.models import User
|
|||
|
||||
def test_detail(user: User):
|
||||
{%- if cookiecutter.username_type == "email" %}
|
||||
assert (
|
||||
reverse("users:detail", kwargs={"pk": user.pk})
|
||||
== f"/users/{user.pk}/"
|
||||
)
|
||||
assert reverse("users:detail", kwargs={"pk": user.pk}) == f"/users/{user.pk}/"
|
||||
assert resolve(f"/users/{user.pk}/").view_name == "users:detail"
|
||||
{%- else %}
|
||||
assert (
|
||||
|
|
Loading…
Reference in New Issue
Block a user