(podcast_pk, user_pk, client_uid)
unsubscribes user from the current podcast on one client

    Takes syned devices into account.
unsubscribes user from the current podcast on one client
unsubscribes user from the current podcast on one client
def unsubscribe(podcast_pk, user_pk, client_uid):
    """unsubscribes user from the current podcast on one client

    Takes syned devices into account."""
    podcast = Podcast.objects.get(pk=podcast_pk)

    User = get_user_model()
    user = User.objects.get(pk=user_pk)

    client = user.client_set.get(uid=client_uid)

    now = datetime.utcnow()
    clients = _affected_clients(client)

    # fully execute unsubscriptions, before firing events
    # otherwise the first fired event might revert the unsubscribe
    changed = list(_perform_unsubscribe(podcast, user, clients, now))
    _fire_events(podcast, user, changed, False)
def unsubscribe ( podcast_pk , user_pk , client_uid ) : podcast = Podcast . objects . get ( pk = podcast_pk ) User = get_user_model ( ) user = User . objects . get ( pk = user_pk ) client = user . client_set . get ( uid = client_uid ) now = datetime . utcnow ( ) clients = _affected_clients ( client ) # fully execute unsubscriptions, before firing events # otherwise the first fired event might revert the unsubscribe changed = list ( _perform_unsubscribe ( podcast , user , clients , now ) ) _fire_events ( podcast , user , changed , False )