mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 01:26:57 +03:00
Switch to local imports within app (#4883)
This commit is contained in:
parent
916f666637
commit
4db3ea1e58
|
@ -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:
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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"]):
|
||||
|
|
|
@ -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 %}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
from celery import shared_task
|
||||
|
||||
from {{ cookiecutter.project_slug }}.users.models import User
|
||||
from .models import User
|
||||
|
||||
|
||||
@shared_task()
|
||||
|
|
|
@ -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 = [
|
||||
|
|
Loading…
Reference in New Issue
Block a user