trial account sattus fix

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-20 09:43:27 +00:00
parent 257b6817f1
commit b0a1125dd4
2 changed files with 3 additions and 2 deletions

View File

@@ -85,7 +85,7 @@ class Account(SoftDeletableModel):
plan = models.ForeignKey('igny8_core_auth.Plan', on_delete=models.PROTECT, related_name='accounts')
credits = models.IntegerField(default=0, validators=[MinValueValidator(0)], help_text="Plan credits (reset on renewal)")
bonus_credits = models.IntegerField(default=0, validators=[MinValueValidator(0)], help_text="Purchased/bonus credits (never expire, never reset)")
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='trial')
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='active')
payment_method = models.CharField(
max_length=30,
choices=PAYMENT_METHOD_CHOICES,

View File

@@ -404,7 +404,8 @@ class RegisterSerializer(serializers.Serializer):
# simple monthly cycle; if annual needed, extend here
billing_period_end = billing_period_start + timedelta(days=30)
else:
account_status = 'trial'
# Free/trial plans get active status immediately
account_status = 'active'
initial_credits = plan.get_effective_credits_per_month()
billing_period_start = None
billing_period_end = None