(podcast, user)
return targets
Clients / SyncGroup on which the podcast can be subscribed

    This excludes all devices/syncgroups on which the podcast is already
    subscribed
Clients / SyncGroup on which the podcast can be subscribed
Clients / SyncGroup on which the podcast can be subscribed
def get_subscribe_targets(podcast, user):
    """Clients / SyncGroup on which the podcast can be subscribed

    This excludes all devices/syncgroups on which the podcast is already
    subscribed"""

    # django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
    from mygpo.users.models import Client

    clients = (
        Client.objects.filter(user=user)
        .exclude(subscription__podcast=podcast, subscription__user=user)
        .select_related("sync_group")
    )

    targets = set()
    for client in clients:
        if client.sync_group:
            targets.add(client.sync_group)
        else:
            targets.add(client)

    return targets
def get_subscribe_targets ( podcast , user ) : # django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet. from mygpo . users . models import Client clients = ( Client . objects . filter ( user = user ) . exclude ( subscription__podcast = podcast , subscription__user = user ) . select_related ( "sync_group" ) ) targets = set ( ) for client in clients : if client . sync_group : targets . add ( client . sync_group ) else : targets . add ( client ) return targets