fix crowdin error for PRs

This commit is contained in:
blitzmann
2022-03-23 22:55:22 -04:00
parent 67119fcff1
commit 518b4abf8c

View File

@@ -6,7 +6,7 @@ import sys
key = os.environ.get("CROWDIN_API_KEY", None)
if key is None:
if key is None or key == '':
# if building from a forked PR, this is normal. Secret veariables are generally unavailable in those circumstances
print("CROWDIN_API_KEY env variable not found, cannot fetch translation status.")
sys.exit()
@@ -20,7 +20,7 @@ resp = requests.get('https://api.crowdin.com/api/project/pyfa/status', params=pa
data = resp.json()
if resp.status_code is not 200:
print("Error fetching Crowdin progress. Error: {}; {}".format(data['error']['message'], key[-3:]))
print("Error fetching Crowdin progress. Error: {}; {}".format(data['error']['message']))
sys.exit()
for x in data: