(user_pk)
Syncs all of the user's sync groups
Syncs all of the user's sync groups
Syncs all of the user s sync groups
def sync_user(user_pk):
    """Syncs all of the user's sync groups"""
    from mygpo.users.models import SubscriptionException

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

    groups = models.SyncGroup.objects.filter(user=user)
    for group in groups:

        try:
            group.sync()

        except SubscriptionException:
            # no need to retry on SubscriptionException
            pass

        except Exception as e:
            logger.exception("retrying task")
            raise sync_user.retry()
def sync_user ( user_pk ) : from mygpo . users . models import SubscriptionException User = get_user_model ( ) user = User . objects . get ( pk = user_pk ) groups = models . SyncGroup . objects . filter ( user = user ) for group in groups : try : group . sync ( ) except SubscriptionException : # no need to retry on SubscriptionException pass except Exception as e : logger . exception ( "retrying task" ) raise sync_user . retry ( )