Switch to local imports within app (#4883)

This commit is contained in:
Matthew Foster Walsh 2024-02-23 09:37:34 -05:00 committed by GitHub
parent 916f666637
commit 4db3ea1e58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 10 additions and 10 deletions

View File

@ -4,9 +4,9 @@ from django.contrib.auth import admin as auth_admin
from django.contrib.auth.decorators import login_required
from django.utils.translation import gettext_lazy as _
from {{ cookiecutter.project_slug }}.users.forms import UserAdminChangeForm
from {{ cookiecutter.project_slug }}.users.forms import UserAdminCreationForm
from {{ cookiecutter.project_slug }}.users.models import User
from .forms import UserAdminChangeForm
from .forms import UserAdminCreationForm
from .models import User
if settings.DJANGO_ADMIN_FORCE_ALLAUTH:
# Force the `admin` sign in process to go through the `django-allauth` workflow:

View File

@ -6,7 +6,7 @@ from django.forms import EmailField
{%- endif %}
from django.utils.translation import gettext_lazy as _
from {{ cookiecutter.project_slug }}.users.models import User
from .models import User
class UserAdminChangeForm(admin_forms.UserChangeForm):

View File

@ -4,7 +4,7 @@ from django.contrib.auth.hashers import make_password
from django.contrib.auth.models import UserManager as DjangoUserManager
if TYPE_CHECKING:
from {{ cookiecutter.project_slug }}.users.models import User # noqa: F401
from .models import User # noqa: F401
class UserManager(DjangoUserManager["User"]):

View File

@ -11,7 +11,7 @@ from django.urls import reverse
from django.utils.translation import gettext_lazy as _
{%- if cookiecutter.username_type == "email" %}
from {{ cookiecutter.project_slug }}.users.managers import UserManager
from .managers import UserManager
{%- endif %}

View File

@ -1,6 +1,6 @@
from celery import shared_task
from {{ cookiecutter.project_slug }}.users.models import User
from .models import User
@shared_task()

View File

@ -1,8 +1,8 @@
from django.urls import path
from {{ cookiecutter.project_slug }}.users.views import user_detail_view
from {{ cookiecutter.project_slug }}.users.views import user_redirect_view
from {{ cookiecutter.project_slug }}.users.views import user_update_view
from .views import user_detail_view
from .views import user_redirect_view
from .views import user_update_view
app_name = "users"
urlpatterns = [