mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 04:49:36 -07:00
Catch exception validating OneSignal ID
This commit is contained in:
parent
5adb6ca19a
commit
4585057a9e
1 changed files with 6 additions and 2 deletions
|
@ -184,8 +184,12 @@ def validate_onesignal_id(onesignal_id):
|
||||||
headers = {'Content-Type': 'application/json'}
|
headers = {'Content-Type': 'application/json'}
|
||||||
payload = {'app_id': _ONESIGNAL_APP_ID}
|
payload = {'app_id': _ONESIGNAL_APP_ID}
|
||||||
|
|
||||||
r = requests.get('https://onesignal.com/api/v1/players/{}'.format(onesignal_id), headers=headers, json=payload)
|
try:
|
||||||
return r.status_code == 200
|
r = requests.get('https://onesignal.com/api/v1/players/{}'.format(onesignal_id), headers=headers, json=payload)
|
||||||
|
return r.status_code == 200
|
||||||
|
except Exception as e:
|
||||||
|
logger.warn("Tautulli MobileApp :: Failed to validate OneSignal ID: %s." % e)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def blacklist_logger():
|
def blacklist_logger():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue