Files
octopus/myproject/myproject/urls_public.py
Andrey Smakotin 52baf4295f fix: add missing imports and routes for password setup flow
- Added get_user_model import in accounts/views.py
- Fixed User variable scope in password_setup_confirm view
- Added accounts URLs to urls_public.py for password setup on main domain
- Password setup link now accessible from public schema

Technical details:
- get_user_model() needed to be imported from django.contrib.auth
- User model reference moved outside try block to fix UnboundLocalError
- accounts.urls included in public URLconf for /accounts/setup-password/ route

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 22:27:23 +03:00

24 lines
899 B
Python

# -*- coding: utf-8 -*-
"""
URL configuration for the PUBLIC schema (inventory.by domain).
This is the main domain where:
- Super admin can access admin panel
- Tenant registration is available
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('tenants.urls')), # Роуты для регистрации тенантов (/, /register/, /register/success/)
path('accounts/', include('accounts.urls')), # Роуты для установки пароля владельцами тенантов
]
# Serve media files in development
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)