Docs: начальная структура проекта

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-25 14:59:46 +00:00
commit 1669c12182
56 changed files with 2085 additions and 0 deletions

10
app/users/utils.py Normal file
View File

@@ -0,0 +1,10 @@
"""Хелперы для пользователей."""
def get_author_employee(user):
"""Возвращает сотрудника (автора) для текущего пользователя, если привязан профиль."""
if not user or not user.is_authenticated:
return None
try:
profile = user.profile
return profile.employee if profile else None
except Exception:
return None