MVP ready. Fully functional (registration? moderation, profiles vew)
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2025-08-12 21:55:56 +09:00
parent b282c44e7c
commit 9af84db429
17 changed files with 782 additions and 18 deletions

View File

@@ -0,0 +1,41 @@
from __future__ import annotations
from telegram import Update, InputMediaPhoto
from telegram.ext import ContextTypes
from app.core.db import db_session
from app.repositories.candidate_repo import CandidateRepository
from app.utils.common import csv_to_list
async def my_profile_handler(update: Update, context: ContextTypes.DEFAULT_TYPE):
"""Команда /my — показать свою анкету."""
with db_session() as s:
repo = CandidateRepository(s)
c = repo.by_tg(update.effective_user.id)
if not c:
await update.message.reply_text("Анкета не найдена. Начни с /new")
return
text = (
f"Твоя анкета:\n"
f"{c.full_name or ''} (@{update.effective_user.username or ''})\n"
f"Город: {c.city or ''}\n"
f"Цель: {c.goal or ''}"
)
if c.avatar_file_id:
await update.message.reply_photo(photo=c.avatar_file_id, caption=text)
else:
await update.message.reply_text(text)
gallery = csv_to_list(c.gallery_file_ids)
if gallery:
media = [InputMediaPhoto(g) for g in gallery[:10]]
await update.message.reply_media_group(media)
async def edit_hint_handler(update: Update, context: ContextTypes.DEFAULT_TYPE):
"""Команда /edit — пока только подсказка о редактировании."""
await update.message.reply_text(
"Точечное редактирование будет добавлено командами /edit_*. Пока что для правок — /new (перезаполнить анкету)."
)