def _gcm_handle_canonical_id(canonical_id, current_id):
	if GCMDevice.objects.filter(registration_id=canonical_id, active=True).exists():
		GCMDevice.objects.filter(registration_id=current_id).update(active=False)
	else:
		GCMDevice.objects.filter(registration_id=current_id).update(registration_id=canonical_id)
Handle situation when GCM server response contains canonical ID
dataset/ETHPy150Open jleclanche/django-push-notifications/push_notifications/gcm.py/_gcm_handle_canonical_id