(podcast, user, clients, timestamp)
Unsubscribes from a podcast on multiple clients

    Yields the clients on which a subscription was removed, ie not those where
    the podcast was not subscribed.
Unsubscribes from a podcast on multiple clients
Unsubscribes from a podcast on multiple clients
def _perform_unsubscribe(podcast, user, clients, timestamp):
    """Unsubscribes from a podcast on multiple clients

    Yields the clients on which a subscription was removed, ie not those where
    the podcast was not subscribed."""

    for client in clients:

        try:
            subscription = Subscription.objects.get(
                user=user, client=client, podcast=podcast
            )
        except Subscription.DoesNotExist:
            continue

        subscription.delete()

        logger.info(
            "{user} unsubscribed from {podcast} on {client}".format(
                user=user, podcast=podcast, client=client
            )
        )

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

        yield client
def _perform_unsubscribe ( podcast , user , clients , timestamp ) : for client in clients : try : subscription = Subscription . objects . get ( user = user , client = client , podcast = podcast ) except Subscription . DoesNotExist : continue subscription . delete ( ) logger . info ( "{user} unsubscribed from {podcast} on {client}" . format ( user = user , podcast = podcast , client = client ) ) HistoryEntry . objects . create ( timestamp = timestamp , podcast = podcast , user = user , client = client , action = HistoryEntry . UNSUBSCRIBE , ) yield client