1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 12:58:34 +00:00

Merge pull request #1359 from haiwen/unlink-device

delete device token when mark device remoted wiped failed
This commit is contained in:
Daniel Pan
2016-09-18 18:21:44 +08:00
committed by GitHub

View File

@@ -28,6 +28,10 @@ def do_unlink_device(username, platform, device_id, remote_wipe=False):
raise
if remote_wipe:
TokenV2.objects.mark_device_to_be_remote_wiped(username, platform, device_id)
try:
TokenV2.objects.mark_device_to_be_remote_wiped(username, platform, device_id)
except Exception as e:
logger.error(e)
TokenV2.objects.delete_device_token(username, platform, device_id)
else:
TokenV2.objects.delete_device_token(username, platform, device_id)