Ignore type errors from mypy

This commit is contained in:
Bruno Alla 2024-05-13 19:53:55 +01:00
parent 34f8a2e154
commit 9fd3154127
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ from .models import User
class UserAdminChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
class Meta(admin_forms.UserChangeForm.Meta): # type: ignore[name-defined]
model = User
{%- if cookiecutter.username_type == "email" %}
field_classes = {"email": EmailField}
@ -23,7 +23,7 @@ class UserAdminCreationForm(admin_forms.UserCreationForm):
To change user signup, see UserSignupForm and UserSocialSignupForm.
"""
class Meta(admin_forms.UserCreationForm.Meta):
class Meta(admin_forms.UserCreationForm.Meta): # type: ignore[name-defined]
model = User
{%- if cookiecutter.username_type == "email" %}
fields = ("email",)

View File

@ -62,7 +62,7 @@ class TestUserAdmin:
# Reload the admin module to apply the setting change
import {{ cookiecutter.project_slug }}.users.admin as users_admin
with contextlib.suppress(admin.sites.AlreadyRegistered):
with contextlib.suppress(admin.sites.AlreadyRegistered): # type: ignore[attr-defined]
reload(users_admin)
@pytest.mark.django_db()