carry out full sync of a user in background
[mygpo.git] / mygpo / users / tasks.py
blob78f22ec3c70ca691c76a9b550eb6efab81371f0e
1 from mygpo.cel import celery
4 @celery.task(max_retries=5, default_retry_delay=60)
5 def sync_user(user):
6 """ Syncs all of the user's device groups """
8 for group in user.get_grouped_devices():
9 if group.is_synced:
10 device = group.devices[0]
11 user.sync_group(device)