Remove the guest system entirely: no is_guest/device_id, no guest throttles, phone login is the only way in

accounts.0008 drops the columns and refuses to run while guest rows exist.
Docs describe the current state; tests that only proved guest behaviour are gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-05 18:20:10 +03:30
parent 8835e01595
commit 663252a260
61 changed files with 357 additions and 1518 deletions

View File

@@ -1,5 +1,5 @@
# Run with: manage.py shell -c "exec(open('tools/loadtest/mkusers.py').read())" env: LT_N, LT_PREFIX, LT_SEED
# Creates N non-guest test users (fake 0900… numbers, no signals, no SMS) and prints
# Creates N test users (fake 0900… numbers, no signals, no SMS) and prints
# [{userId, token, grade, asks:[{lessonId, question}], nodeId, questionIds}] as JSON.
import json
import os
@@ -18,7 +18,7 @@ out = []
for i in range(N):
grade = GRADES[i % len(GRADES)]
phone = f'{PREFIX}{i:04d}'
user, _ = User.objects.get_or_create(phone=phone, defaults={'is_guest': False, 'name': f'تست بار {i}', 'grade_id': grade})
user, _ = User.objects.get_or_create(phone=phone, defaults={'name': f'تست بار {i}', 'grade_id': grade})
qs = list(Question.objects.filter(lesson__node__unit__grade_id=grade).select_related('lesson__node')
.values_list('id', 'prompt', 'lesson_id', 'lesson__node_id')[:4000])
picks = rnd.sample(qs, 6)