@@ -239,7 +239,7 @@ async def handle_gitlab_webhook(request): updated_count = await PaymentPlanUserInfo.objects.filter( plan__price__gt=0, plan__individual=False, - ).aupdate(next_payment_at=None if not is_active else (timezone.now() + relativedelta(months=1))) + ).aupdate(next_payment_at=None if not is_active else (timezone.now() + timedelta(days=30))) logger.info( 'Recurring feature flag synced: active=%s updated_subscriptions=%s', is_active, @@ -1,10 +1,10 @@ import logging +from datetime import timedelta from decimal import Decimal from uuid import UUID, uuid4 from asgiref.sync import sync_to_async -from dateutil.relativedelta import relativedelta from django.conf import settings from django.db import transaction from django.utils import timezone @@ -118,7 +118,7 @@ class PaymentService: ): payment_method = PaymentMethodService(self.user).add_payment_method(payment.payment_method) PaymentPlanUserInfo.objects.filter(user=self.user).update( - method=payment_method, next_payment_at=timezone.now() + relativedelta(months=1) + method=payment_method, next_payment_at=timezone.now() + timedelta(days=30) ) logger.info( 'Recurring payment method saved: email=%s method_uid=%s next_payment_at_set=true', @@ -128,7 +128,7 @@ class PaymentService: else: if web_client.get_flag_state('recurring_payments', self.user.email) and not plan.individual: PaymentPlanUserInfo.objects.filter(user=self.user).update( - next_payment_at=timezone.now() + relativedelta(months=1) + next_payment_at=timezone.now() + timedelta(days=30) ) logger.info( 'Recurring schedule updated without saved method: email=%s next_payment_at_set=true',