(podcast, user, clients, timestamp, ref_url)
Subscribes to a podcast on multiple clients

    Yields the clients on which a subscription was added, ie not those where
    the subscription already existed.
Subscribes to a podcast on multiple clients
Subscribes to a podcast on multiple clients
def _perform_subscribe(podcast, user, clients, timestamp, ref_url):
    """Subscribes to a podcast on multiple clients

    Yields the clients on which a subscription was added, ie not those where
    the subscription already existed."""

    for client in clients:
        subscription, created = Subscription.objects.get_or_create(
            user=user,
            client=client,
            podcast=podcast,
            defaults={
                "ref_url": to_maxlength(Subscription, "ref_url", ref_url),
                "created": timestamp,
                "modified": timestamp,
            },
        )

        if not created:
            continue

        logger.info(
            "{user} subscribed to {podcast} on {client}".format(
                user=user, podcast=podcast, client=client
            )
        )

        HistoryEntry.objects.create(
            timestamp=timestamp,
            podcast=podcast,
            user=user,
            client=client,
            action=HistoryEntry.SUBSCRIBE,
        )

        yield client
def _perform_subscribe ( podcast , user , clients , timestamp , ref_url ) : for client in clients : subscription , created = Subscription . objects . get_or_create ( user = user , client = client , podcast = podcast , defaults = { "ref_url" : to_maxlength ( Subscription , "ref_url" , ref_url ) , "created" : timestamp , "modified" : timestamp , } , ) if not created : continue logger . info ( "{user} subscribed to {podcast} on {client}" . format ( user = user , podcast = podcast , client = client ) ) HistoryEntry . objects . create ( timestamp = timestamp , podcast = podcast , user = user , client = client , action = HistoryEntry . SUBSCRIBE , ) yield client