Require club cards in cashier enrollment and restore ticket owners
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -359,7 +359,8 @@ async def add_accounts_to_lottery(callback: CallbackQuery, state: FSMContext):
|
||||
|
||||
lottery_title = lottery.title
|
||||
from .account_services import AccountParticipationService
|
||||
result = await AccountParticipationService.add_accounts_bulk(session, lottery_id, [a['account_number'] for a in accounts])
|
||||
entries = [f"{a.get('club_card') or ''} {a['account_number']}".strip() for a in accounts]
|
||||
result = await AccountParticipationService.add_accounts_bulk(session, lottery_id, entries, require_card=True)
|
||||
success_count = result['added']
|
||||
errors = result['errors']
|
||||
|
||||
@@ -368,6 +369,8 @@ async def add_accounts_to_lottery(callback: CallbackQuery, state: FSMContext):
|
||||
|
||||
if success_count:
|
||||
text += f"✅ Добавлено счетов: {success_count}\n\n"
|
||||
if result['linked']:
|
||||
text += f"✅ Привязано существующих участий: {result['linked']}\n\n"
|
||||
|
||||
if errors:
|
||||
text += f"⚠️ Ошибки: {len(errors)}\n"
|
||||
|
||||
Reference in New Issue
Block a user