- Add birth_date, created_at/updated_at to Employee; remove username field - Introduce EmployeeAction for tracking HR events and is_actually_active/status properties - Create BotSubscriber model (OneToOne relation) for TG/WA binding - Implement Aiogram-based Telegram bot: • request contact to bind by phone or @username • department selection keyboard from DEPARTMENTS dict • async ORM via sync_to_async, custom filters for bound & active employees - Update profile view & template: • show “Bind Telegram/WhatsApp” button only when not already bound • preview avatar on upload - Remove registration tokens in favor of contact-based auth - Clean up templates, forms and add avatar validation mixin
23 lines
933 B
Python
23 lines
933 B
Python
from django.contrib import admin
|
|
from django.urls import include, path, reverse_lazy
|
|
from django.views.generic.edit import CreateView
|
|
from users.forms import RegistrationForm
|
|
from users.views import profile, avatar_remove
|
|
from django.conf.urls.static import static
|
|
from django.conf import settings
|
|
|
|
|
|
urlpatterns = [
|
|
path('admin/', admin.site.urls),
|
|
path('auth/', include('django.contrib.auth.urls')),
|
|
path('auth/register/', CreateView.as_view(
|
|
template_name='registration/register.html',
|
|
form_class=RegistrationForm,
|
|
success_url=reverse_lazy('profile')
|
|
), name='register'),
|
|
path('avatar/remove/', avatar_remove, name='avatar_remove'),
|
|
path('calendar/', include('calendar_app.urls', namespace='calendar')),
|
|
path('documents/', include('documents.urls', namespace='documents')),
|
|
path('', profile, name='profile'),
|
|
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
|