pwa: delete pwa push subscription on 410 errors (#41304)
This commit is contained in:
parent
8f4a5869bd
commit
f51551101c
|
@ -59,5 +59,8 @@ def notification(sender, instance=None, created=False, **kwargs):
|
|||
vapid_claims=claims,
|
||||
)
|
||||
except pywebpush.WebPushException as e:
|
||||
if str(e) == 'Push failed: 410 Gone':
|
||||
subscription.delete()
|
||||
continue
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.exception('webpush error (%r)', e)
|
||||
|
|
Loading…
Reference in New Issue