Stripe checkout #104411
@ -19,7 +19,7 @@ def has_active_subscription(user: User) -> bool:
|
||||
active_subscriptions: 'QuerySet[Subscription]' = Subscription.objects.active()
|
||||
|
||||
return active_subscriptions.filter(
|
||||
Q(customer__user_id=user.id) | Q(team__team_users__user_id=user.id)
|
||||
Q(customer=user.customer) | Q(team__team_users__user_id=user.id)
|
||||
).exists()
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@ def has_non_legacy_subscription(user: User) -> bool:
|
||||
subscriptions: 'QuerySet[Subscription]' = Subscription.objects.filter(is_legacy=False)
|
||||
|
||||
return subscriptions.filter(
|
||||
Q(customer__user_id=user.id) | Q(team__team_users__user_id=user.id)
|
||||
Q(customer=user.customer) | Q(team__team_users__user_id=user.id)
|
||||
).exists()
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ def has_subscription(user: User) -> bool:
|
||||
return False
|
||||
|
||||
return Subscription.objects.filter(
|
||||
Q(customer__user_id=user.id) | Q(team__team_users__user_id=user.id)
|
||||
Q(customer=user.customer) | Q(team__team_users__user_id=user.id)
|
||||
).exists()
|
||||
|
||||
|
||||
@ -79,4 +79,4 @@ def has_not_yet_cancelled_subscription(user: User) -> bool:
|
||||
status__in=Subscription._CANCELLED_STATUSES
|
||||
)
|
||||
|
||||
return not_yet_cancelled_subscriptions.filter(Q(customer__user_id=user.id)).exists()
|
||||
return not_yet_cancelled_subscriptions.filter(Q(customer=user.customer)).exists()
|
||||
|
Loading…
Reference in New Issue
Block a user