Переглянути джерело

grants: skip companies that can't be found

a company received a grant and changed their CO with a supporter pack
raylu 2 тижнів тому
батько
коміт
5370fe8958
1 змінених файлів з 5 додано та 1 видалено
  1. 5 1
      punoted/grants.py

+ 5 - 1
punoted/grants.py

@@ -16,7 +16,11 @@ def main() -> None:
 		if co is None:
 			print('\n')
 			continue
-		company = cache.get('https://rest.fnar.net/company/code/' + co)
+		try:
+			company = cache.get('https://rest.fnar.net/company/code/' + co)
+		except cache.NoContent:
+			print('no FIO REST data for', co)
+			continue
 		co_id = company['CompanyId']
 		username = company['UserName']
 		print(username, end='\t')