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

@@ -23,7 +23,7 @@ class UserHeartsRegenTests(TestCase):
def setUp(self):
self.client = APIClient()
self.user = User.objects.create(device_id='dev-hearts-regen', is_guest=True, name='')
self.user = User.objects.create(phone='09000000001', name='')
self.token = issue_access_token(self.user.id)
def _get_hearts(self):
@@ -75,7 +75,7 @@ class CharacterGamificationTests(TestCase):
def setUp(self):
self.client = APIClient()
self.user = User.objects.create(device_id='device-characters-1', is_guest=True, name='')
self.user = User.objects.create(phone='09000000002', name='')
self.token = issue_access_token(self.user.id)
self.owl = Character.objects.create(slug='owl', name='جغد', icon='owl', unlock_xp=0, order=1)
@@ -275,7 +275,7 @@ class LeaderboardPeriodValidationTests(TestCase):
from rest_framework.test import APIClient
self.client = APIClient()
user = User.objects.create(device_id='lb-dev', is_guest=True)
user = User.objects.create(phone='09000000003')
self.client.credentials(HTTP_AUTHORIZATION=f'Bearer {issue_access_token(user.id)}')
def test_unknown_period_is_a_400(self):