Files
zulip/zerver/management/commands/check_apns_tokens.py
Leo Franchi dc8bfde0b4 Add a check_apns_tokens manage.py command to flush old tokens
(imported from commit 15dcfaa1967bd749b582882c4a816a457ca6cc12)
2013-10-24 14:54:31 -04:00

19 lines
543 B
Python

from __future__ import absolute_import
from django.core.management.base import BaseCommand
from django.conf import settings
from zerver.models import AppleDeviceToken
from zerver.lib.push_notifications import check_apns_feedback
import logging
class Command(BaseCommand):
help = """Checks the Apple Push Notifications Service for any tokens that have been
invalidated, and removes them from the database.
Usage: ./manage.py check_apns_tokens"""
def handle(self, *args, **options):
check_apns_feedback()