(self, *args, **kwargs)
return context
Inject is_plans_plural and customer into context_data.
Inject is_plans_plural and customer into context_data.
Inject is_plans_plural and customer into context_data .
def get_context_data(self, *args, **kwargs):
        """Inject is_plans_plural and customer into context_data."""
        context = super().get_context_data(**kwargs)
        context["is_plans_plural"] = Plan.objects.count() > 1
        context["customer"], _created = Customer.get_or_create(
            subscriber=djstripe_settings.subscriber_request_callback(self.request)
        )
        context["subscription"] = context["customer"].subscription
        return context
def get_context_data ( self , * args , * * kwargs ) : context = super ( ) . get_context_data ( * * kwargs ) context [ "is_plans_plural" ] = Plan . objects . count ( ) > 1 context [ "customer" ] , _created = Customer . get_or_create ( subscriber = djstripe_settings . subscriber_request_callback ( self . request ) ) context [ "subscription" ] = context [ "customer" ] . subscription return context