Don't send to sign if it's not configured

This commit is contained in:
Tanner Collin 2021-12-03 05:20:02 +00:00
parent 7b5dac7c6e
commit 4079896dc8

View File

@ -575,6 +575,7 @@ class StatsViewSet(viewsets.ViewSet, List):
sign = request.data['sign']
cache.set('sign', sign)
if secrets.SIGN_TOKEN:
try:
post_data = dict(access_token=secrets.SIGN_TOKEN, args=sign)
r = requests.post('https://api.particle.io/v1/devices/200042000647343232363230/text/', data=post_data, timeout=5)