Bazaar: plans cache cleared by migration 0014, enum name override, CLAUDE.md status

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-12 17:59:43 +03:30
parent 8077ab4350
commit 76b0ef976e
2 changed files with 16 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ com.tadrisino.math.app شناخت (پرسشِ API با توکنِ ساختگی:
پلن‌ها با مدت پیدا می‌شوند، نه با id (idها بین دیتابیس‌ها فرق دارند). اگر دقیقاً یک پلنِ فروشیِ هم‌مدت
نباشد، migration می‌شکند تا دستی دیده شود؛ SKUی که ادمین از پیش گذاشته دست نمی‌خورد.
"""
from django.core.cache import cache
from django.db import migrations
SKUS = {90: '10343', 180: '10344'}
@@ -27,6 +28,9 @@ def forward(apps, schema_editor):
continue
plan.bazaar_sku = sku
plan.save(update_fields=['bazaar_sku'])
# مدلِ تاریخیِ migration سیگنالِ post_save (subscription/receivers.py) را نمی‌زند؛ بی‌این فهرستِ پلن‌ها تا یک
# ساعت SKUی خالی نشان می‌داد (روی سرور دیده شد). کلید همان PLANS_CACHE_KEY است، کپی تا migration به view وابسته نشود.
cache.delete('subscription:plans:v3')
def backward(apps, schema_editor):